diff --git a/apfelkern/CHANGELOG.md b/apfelkern/CHANGELOG.md index ef17b32..900b321 100644 --- a/apfelkern/CHANGELOG.md +++ b/apfelkern/CHANGELOG.md @@ -2,6 +2,20 @@ ## Unreleased +- Allow edits to completed one-time automations without changing their trigger or rerunning them. Preserve the saved timestamp, and expose `AutomationBoard.draftPreviewProblem` for both apps' Save buttons. +- Keep job history updating when a read takes longer than the polling interval. Polling waits for the current history load; explicit refreshes still supersede older loads. +- Update the contract copy for the server's file library. Messages no longer carry inline base64 attachments: `APIClient.uploadFile(_:_:)` and `uploadGroupFile(_:_:)` upload a `PendingAttachment`'s raw bytes with its name and MIME type and return a file ID, and `sendChatMessage` and `sendGroupMessage` take `files`. `file(_:fileID:)` and `groupFile(_:fileID:)` download by file ID; `groupAttachment` is gone, and `attachment(_:entryID:index:)` remains for desktop screenshots. `OutgoingAttachment`, `OutgoingGroupAttachment`, and `PendingAttachment.outgoing` are gone. +- `AttachmentInfo` gains `id` and `deleted` and loses `kind`; `isImage` follows the MIME type, and `.deleted(_:)` stands for a file deleted from its library. Add `DeletedFiles`, which carries a deletion to every message in the chat that lists the file, and `GroupChatHost.deletedFiles` and `selectedAgentID`. +- `BotChatDelivery` keeps each pending send's uploaded file IDs, so a retry uploads only what an earlier attempt missed. `fail(botID:requestID:error:)` drops them when the server rejects the send because a file was deleted or isn't in the library, so the next retry uploads again under the same request ID. Add `uploadedFile`, `recordUpload`, and `isPending`. +- `GroupChatHost` gains `uploadFiles(_:chat:requestID:generation:upload:)`, which both apps' bot and group sends use and which stops when the connection changes, `conversationKey`, `attachmentKey(_:index:)`, and `downloadAttachment(entryID:index:cached:)`, which drops a download whose file was deleted or whose chat or connection changed meanwhile. +- Adopt the server's chat attention contract. `APIClient.pushPresence` is gone, and `reportChatAttention(view:chat:)` and `markRepliesSeen(_:in:)` take its place. Add `ChatAttention`, which reports one view's `ChatAttentionChat` only while the app is active, its route shows that chat, and the chat is mounted; refreshes every 30 seconds; sends one report at a time with the newest state, so a refresh can't land after a clear; gives each connection a new view ID and clears the old view through the old session; and `disconnect(_:)` clears within two seconds before sign-out. It acknowledges replies whose surface is ready and on screen, in batches of up to 100 per chat that keep their chat across navigation, retry while the connection lasts, split a refused batch to drop only the refused events, and stop when the session ends. +- `Message` gains `replyReferences`, `ReplyReference`s with their `ReplySurface`, over HTTP and both event streams, and `attentionEventIDs(for:)`, `showsReplyText`, and `replyCard(heldActions:botRequests:callRequests:botSecrets:)`, which names a waiting card's surface and whether its board has the server's state. Add `ReplySurfaces`, `replySurfaceVisible(ready:frame:viewport:)`, `Route.attentionChat`, `ActivityEvent.attentionChat`, `HeldActionBoard.isReady(_:)`, `BotRequestBoard.isLoaded(_:)`, `CallRequestBoard.isLoaded(_:)`, and `BotSecretBoard.isReady(_:)`. +- `GroupChatHost` requires `snapshotRevision` and `applySnapshot(_:)` and gains `refreshReplyReferences(after:active:)`, which reloads the chat on screen after a live reply and drops the reload when a snapshot, a newer reload, a new selection, or a new connection lands first. +- Automations use the server's timing. `Schedule` gains `description`, `timing`, and `nextRunLabel`, and `cadence`, `automationTiming`, `cronPhrase`, `humanRun`, `nextRunLabel(_:now:)`, `CronExpression`, `AutomationDraft.preview(now:)`, and the draft's trigger and time zone checks in `problem` are gone. `APIClient.previewAutomation(_:)` previews an `AutomationDraft.previewRequest`. `AutomationBoard` gains `draftPreview`; `loadPreview(client:after:)`, which waits for the trigger to settle and drops an answer for an older trigger, another draft, or another connection; and `follow(client:every:)`, which rereads the list each minute while it shows. For a new or changed trigger, `saveDraft` stops at a preview's problem; without a preview, the server checks the trigger as it saves. A row waiting for the server reads **Saving…**, and a paused one says so at once. +- Reasoning uses the server's preview. `APIClient.previewReasoning(provider:model:level:)` returns a `ReasoningPreview` with its `ReasoningOption`s and the level a turn runs at. `ReasoningBoard` keeps previews per connection, with `preview(provider:model:level:)`, `preview(of:)`, and `load`, which waits for its inputs to settle, in place of `load(provider:client:)`, `levels(of:)`, and `level(of:)`. `ThinkingLevel.clamped(to:)`, `available(for:in:)`, and `title` are gone, and `ReasoningField` takes a preview. +- `Message.blocks` is `[TranscriptBlock]`, the generated type that HTTP and the event stream share. `Message` gains `presentation`, `presentedText`, and `citations`, the server's reply text without citation links and the pages it cited, and `sources`, `MessageSource`, `SourceChip`, and `SourceCitations` are gone. `ChatSnapshot` gains `working`, which `isRunning` follows, and `Working(snapshot:messages:)` is gone. +- Job history is a `JobHistoryPage` with the server's `JobHistoryItem`s. `JobHistory.items` replaces `messages`, `CodingJobItem` is gone, and `mergeJobItems(_:_:)` joins pages. A refresh rereads older pages for steps still waiting on their result. + - Add outside calls: `CallRequest` (a bot's proposal to call someone other than the owner, read from a `request_call` result or `APIClient.callRequests(_:)`), `approveCallRequest`, `declineCallRequest`, and `callRequestTranscript`, and `CallRequestBoard`, whose decisions show pending until the server confirms and whose refused approval exposes the server's text. `CallEvent` gains `callee`, and `shownInChat(_:)` hides the `call-started` event of an outside call and shows a call request card. Add `CallRequest.stateLabel`, `callRequest(for:in:)`, `callNoticeDetail(_:request:)`, and `callTranscriptLines(_:)`. `noticeTitle(_:)` names a `call_request` notice **Call request**. - Update the contract copy for the voice gateway. `Message` gains `call`, a `CallEvent` with the call's ID and direction. Add `CallMarker`, which reads a `call-started` or `call-ended` event and the `call` notice whose end woke the bot, and `gatewayOrigin(_:)`, which reads "Spoken on a call" for a spoken message. `noticeTitle(_:)` names a `call` notice **Call**. `BotAvatar` gains `CallMarkerView`, and `GatewayOriginLabel` shows a phone for a spoken message. - `scripts/contract.py --update DIRECTORY` copies the contract files from a directory such as `bot/openapi/`. `Contract/` no longer carries `pin.json`, `SHA256SUMS`, `CHANGELOG.md`, or `source-commit.txt`, and the weekly contract update workflow is gone. diff --git a/apfelkern/Contract/chat-snapshot.schema.json b/apfelkern/Contract/chat-snapshot.schema.json index 16275c4..abf4021 100644 --- a/apfelkern/Contract/chat-snapshot.schema.json +++ b/apfelkern/Contract/chat-snapshot.schema.json @@ -22,7 +22,12 @@ "content": { "type": "string" }, - "blocks": {}, + "blocks": { + "type": "array", + "items": { + "$ref": "#/$defs/TranscriptBlock" + } + }, "stopReason": { "type": "string" }, @@ -38,6 +43,76 @@ "replyPreview": { "type": "string" }, + "replyReferences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string", + "minLength": 1 + }, + "surface": { + "oneOf": [ + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "text" + } + }, + "required": [ + "kind" + ], + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "tool-card" + }, + "toolCallId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "toolCallId" + ], + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "held-action" + }, + "actionId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "actionId" + ], + "additionalProperties": true + } + ] + } + }, + "required": [ + "eventId", + "surface" + ], + "additionalProperties": true + } + }, "origin": { "type": "object", "properties": { @@ -168,35 +243,52 @@ ], "additionalProperties": true }, - "attachments": { + "files": { "type": "array", "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "mimeType": { - "type": "string" - }, - "size": { - "type": "number" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "size": { + "type": "number" + } + }, + "required": [ + "id", + "name", + "mimeType", + "size" + ], + "additionalProperties": true }, - "kind": { - "type": "string", - "enum": [ - "image", - "text" - ] + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "deleted" + ], + "additionalProperties": true } - }, - "required": [ - "name", - "mimeType", - "size", - "kind" - ], - "additionalProperties": true + ] } }, "toolCallId": { @@ -209,6 +301,9 @@ "type": "boolean" }, "toolDetails": {}, + "presentation": { + "$ref": "#/$defs/MessagePresentation" + }, "sources": { "type": "array", "items": { @@ -233,7 +328,8 @@ "id", "entryId", "role", - "content" + "content", + "replyReferences" ], "additionalProperties": true } @@ -297,6 +393,19 @@ "failed" ] }, + "working": { + "type": "string", + "enum": [ + "idle", + "thinking", + "writing", + "searching", + "remembering", + "tinkering", + "struggling", + "failed" + ] + }, "updatedAt": { "type": "number" }, @@ -316,8 +425,146 @@ "conversation", "partial", "status", + "working", "updatedAt", "error" ], - "additionalProperties": true + "additionalProperties": true, + "$defs": { + "TranscriptBlock": { + "oneOf": [ + { + "$ref": "#/$defs/TranscriptTextBlock" + }, + { + "$ref": "#/$defs/TranscriptThinkingBlock" + }, + { + "$ref": "#/$defs/TranscriptImageBlock" + }, + { + "$ref": "#/$defs/TranscriptToolCallBlock" + } + ] + }, + "TranscriptTextBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": true + }, + "TranscriptThinkingBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "thinking" + }, + "thinking": { + "type": "string" + }, + "redacted": { + "type": "boolean" + } + }, + "required": [ + "type", + "thinking" + ], + "additionalProperties": true + }, + "TranscriptImageBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "type", + "mimeType" + ], + "additionalProperties": true + }, + "TranscriptToolCallBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "toolCall" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "arguments": { + "type": "object", + "additionalProperties": {} + } + }, + "required": [ + "type", + "id", + "name", + "arguments" + ], + "additionalProperties": true + }, + "MessagePresentation": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "citations": { + "type": "array", + "items": { + "$ref": "#/$defs/Citation" + } + } + }, + "required": [ + "text", + "citations" + ], + "additionalProperties": true + }, + "Citation": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "title": { + "type": "string" + }, + "site": { + "type": "string" + } + }, + "required": [ + "href", + "title", + "site" + ], + "additionalProperties": true + } + } } diff --git a/apfelkern/Contract/group-chat-snapshot.schema.json b/apfelkern/Contract/group-chat-snapshot.schema.json index cdcdd9a..d099d68 100644 --- a/apfelkern/Contract/group-chat-snapshot.schema.json +++ b/apfelkern/Contract/group-chat-snapshot.schema.json @@ -22,7 +22,12 @@ "content": { "type": "string" }, - "blocks": {}, + "blocks": { + "type": "array", + "items": { + "$ref": "#/$defs/TranscriptBlock" + } + }, "stopReason": { "type": "string" }, @@ -38,6 +43,76 @@ "replyPreview": { "type": "string" }, + "replyReferences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string", + "minLength": 1 + }, + "surface": { + "oneOf": [ + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "text" + } + }, + "required": [ + "kind" + ], + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "tool-card" + }, + "toolCallId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "toolCallId" + ], + "additionalProperties": true + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "const": "held-action" + }, + "actionId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "actionId" + ], + "additionalProperties": true + } + ] + } + }, + "required": [ + "eventId", + "surface" + ], + "additionalProperties": true + } + }, "origin": { "type": "object", "properties": { @@ -168,35 +243,52 @@ ], "additionalProperties": true }, - "attachments": { + "files": { "type": "array", "items": { - "type": "object", - "properties": { - "name": { - "type": "string" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "size": { + "type": "number" + } + }, + "required": [ + "id", + "name", + "mimeType", + "size" + ], + "additionalProperties": true }, - "mimeType": { - "type": "string" - }, - "size": { - "type": "number" - }, - "kind": { - "type": "string", - "enum": [ - "image", - "text" - ] + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean", + "const": true + } + }, + "required": [ + "id", + "deleted" + ], + "additionalProperties": true } - }, - "required": [ - "name", - "mimeType", - "size", - "kind" - ], - "additionalProperties": true + ] } }, "toolCallId": { @@ -209,6 +301,9 @@ "type": "boolean" }, "toolDetails": {}, + "presentation": { + "$ref": "#/$defs/MessagePresentation" + }, "sources": { "type": "array", "items": { @@ -233,7 +328,8 @@ "id", "entryId", "role", - "content" + "content", + "replyReferences" ], "additionalProperties": true } @@ -339,5 +435,142 @@ "activity", "updatedAt" ], - "additionalProperties": true + "additionalProperties": true, + "$defs": { + "TranscriptBlock": { + "oneOf": [ + { + "$ref": "#/$defs/TranscriptTextBlock" + }, + { + "$ref": "#/$defs/TranscriptThinkingBlock" + }, + { + "$ref": "#/$defs/TranscriptImageBlock" + }, + { + "$ref": "#/$defs/TranscriptToolCallBlock" + } + ] + }, + "TranscriptTextBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text" + }, + "text": { + "type": "string" + } + }, + "required": [ + "type", + "text" + ], + "additionalProperties": true + }, + "TranscriptThinkingBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "thinking" + }, + "thinking": { + "type": "string" + }, + "redacted": { + "type": "boolean" + } + }, + "required": [ + "type", + "thinking" + ], + "additionalProperties": true + }, + "TranscriptImageBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "image" + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "type", + "mimeType" + ], + "additionalProperties": true + }, + "TranscriptToolCallBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "toolCall" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "arguments": { + "type": "object", + "additionalProperties": {} + } + }, + "required": [ + "type", + "id", + "name", + "arguments" + ], + "additionalProperties": true + }, + "MessagePresentation": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "citations": { + "type": "array", + "items": { + "$ref": "#/$defs/Citation" + } + } + }, + "required": [ + "text", + "citations" + ], + "additionalProperties": true + }, + "Citation": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "title": { + "type": "string" + }, + "site": { + "type": "string" + } + }, + "required": [ + "href", + "title", + "site" + ], + "additionalProperties": true + } + } } diff --git a/apfelkern/Contract/openapi.json b/apfelkern/Contract/openapi.json index 34532a2..e11d319 100644 --- a/apfelkern/Contract/openapi.json +++ b/apfelkern/Contract/openapi.json @@ -1308,6 +1308,19 @@ "failed" ] }, + "working": { + "type": "string", + "enum": [ + "idle", + "thinking", + "writing", + "searching", + "remembering", + "tinkering", + "struggling", + "failed" + ] + }, "updatedAt": { "type": "number" }, @@ -1324,6 +1337,7 @@ "conversation", "partial", "status", + "working", "updatedAt", "error" ] @@ -1349,7 +1363,10 @@ "type": "string" }, "blocks": { - "description": "Provider content blocks, with inline image bytes removed." + "type": "array", + "items": { + "$ref": "#/components/schemas/TranscriptBlock" + } }, "stopReason": { "type": "string" @@ -1367,6 +1384,78 @@ "replyPreview": { "type": "string" }, + "replyReferences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventId": { + "type": "string", + "minLength": 1 + }, + "surface": { + "oneOf": [ + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "text" + ] + } + }, + "required": [ + "kind" + ] + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "tool-card" + ] + }, + "toolCallId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "toolCallId" + ] + }, + { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "held-action" + ] + }, + "actionId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "actionId" + ] + } + ] + } + }, + "required": [ + "eventId", + "surface" + ] + } + }, "origin": { "$ref": "#/components/schemas/MessageOrigin" }, @@ -1443,10 +1532,52 @@ ], "description": "On a `call-started` or `call-ended` event: the call." }, - "attachments": { + "files": { "type": "array", "items": { - "$ref": "#/components/schemas/AttachmentInfo" + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "size": { + "type": "number" + } + }, + "required": [ + "id", + "name", + "mimeType", + "size" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "required": [ + "id", + "deleted" + ] + } + ] } }, "toolCallId": { @@ -1461,6 +1592,9 @@ "toolDetails": { "description": "Provider-specific tool details, including nested code-mode calls. A successful `desktop_screenshot` result has `{ mimeType, size }`; read its image from `GET /v1/agents/{id}/attachments/{entryId}/0`." }, + "presentation": { + "$ref": "#/components/schemas/MessagePresentation" + }, "sources": { "type": "array", "items": { @@ -1485,7 +1619,117 @@ "id", "entryId", "role", - "content" + "content", + "replyReferences" + ] + }, + "TranscriptBlock": { + "oneOf": [ + { + "$ref": "#/components/schemas/TranscriptTextBlock" + }, + { + "$ref": "#/components/schemas/TranscriptThinkingBlock" + }, + { + "$ref": "#/components/schemas/TranscriptImageBlock" + }, + { + "$ref": "#/components/schemas/TranscriptToolCallBlock" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "text": "#/components/schemas/TranscriptTextBlock", + "thinking": "#/components/schemas/TranscriptThinkingBlock", + "image": "#/components/schemas/TranscriptImageBlock", + "toolCall": "#/components/schemas/TranscriptToolCallBlock" + } + } + }, + "TranscriptTextBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "text": { + "type": "string" + } + }, + "required": [ + "type", + "text" + ] + }, + "TranscriptThinkingBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "thinking" + ] + }, + "thinking": { + "type": "string" + }, + "redacted": { + "type": "boolean" + } + }, + "required": [ + "type", + "thinking" + ] + }, + "TranscriptImageBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "image" + ] + }, + "mimeType": { + "type": "string" + } + }, + "required": [ + "type", + "mimeType" + ] + }, + "TranscriptToolCallBlock": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "toolCall" + ] + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "arguments": { + "type": "object", + "additionalProperties": {} + } + }, + "required": [ + "type", + "id", + "name", + "arguments" ] }, "MessageOrigin": { @@ -1551,31 +1795,41 @@ "status" ] }, - "AttachmentInfo": { + "MessagePresentation": { "type": "object", "properties": { - "name": { + "text": { "type": "string" }, - "mimeType": { + "citations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Citation" + } + } + }, + "required": [ + "text", + "citations" + ] + }, + "Citation": { + "type": "object", + "properties": { + "href": { "type": "string" }, - "size": { - "type": "number" + "title": { + "type": "string" }, - "kind": { - "type": "string", - "enum": [ - "image", - "text" - ] + "site": { + "type": "string" } }, "required": [ - "name", - "mimeType", - "size", - "kind" + "href", + "title", + "site" ] }, "Conversation": { @@ -1721,39 +1975,168 @@ "status" ] }, - "DesktopJobs": { - "type": "object", - "properties": { - "jobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DesktopJob" + "JobHistoryPage": { + "allOf": [ + { + "$ref": "#/components/schemas/TranscriptPage" + }, + { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JobHistoryItem" + } + } }, - "description": "Oldest job first." + "required": [ + "items" + ] } - }, - "required": [ - "jobs" ] }, - "DesktopJob": { - "type": "object", - "properties": { - "name": { - "type": "string" + "JobHistoryItem": { + "oneOf": [ + { + "$ref": "#/components/schemas/JobTaskItem" }, - "conversationId": { - "type": "string" + { + "$ref": "#/components/schemas/JobReplyItem" }, - "status": { + { + "$ref": "#/components/schemas/JobStepItem" + } + ], + "discriminator": { + "propertyName": "kind", + "mapping": { + "task": "#/components/schemas/JobTaskItem", + "reply": "#/components/schemas/JobReplyItem", + "step": "#/components/schemas/JobStepItem" + } + } + }, + "JobTaskItem": { + "type": "object", + "properties": { + "kind": { "type": "string", "enum": [ - "working", - "idle" + "task" ] }, - "model": { - "type": "object", + "id": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "required": [ + "kind", + "id", + "text" + ] + }, + "JobReplyItem": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "reply" + ] + }, + "id": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "required": [ + "kind", + "id", + "text" + ] + }, + "JobStepItem": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "step" + ] + }, + "id": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "label": { + "type": "string" + }, + "icon": { + "type": "string", + "enum": [ + "terminal", + "file", + "pencil", + "pointer", + "tool" + ] + }, + "subject": { + "type": "string" + }, + "result": { + "$ref": "#/components/schemas/TranscriptMessage" + } + }, + "required": [ + "kind", + "id", + "tool", + "label", + "icon" + ] + }, + "DesktopJobs": { + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DesktopJob" + }, + "description": "Oldest job first." + } + }, + "required": [ + "jobs" + ] + }, + "DesktopJob": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "working", + "idle" + ] + }, + "model": { + "type": "object", "properties": { "provider": { "type": "string" @@ -1862,6 +2245,49 @@ "expiresAt" ] }, + "UploadFile": { + "type": "object", + "properties": { + "file": { + "$ref": "#/components/schemas/LibraryFile" + }, + "existed": { + "type": "boolean" + } + }, + "required": [ + "file", + "existed" + ] + }, + "LibraryFile": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "createdAt": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "mimeType", + "size", + "createdAt" + ] + }, "Compaction": { "type": "object", "properties": { @@ -3534,6 +3960,15 @@ "null" ] }, + "nextRunLabel": { + "type": "string" + }, + "description": { + "type": "string" + }, + "timing": { + "type": "string" + }, "createdAt": { "type": "string" }, @@ -3559,10 +3994,39 @@ "eventSourceId", "enabled", "nextRunAt", + "nextRunLabel", + "description", + "timing", "createdAt", "createdByAgentId" ] }, + "SchedulePreview": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "text": { + "type": "string" + }, + "isProblem": { + "type": "boolean" + }, + "nextRunAt": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "description", + "text", + "isProblem", + "nextRunAt" + ] + }, "ScheduleRun": { "type": "object", "properties": { @@ -3943,6 +4407,57 @@ "message" ] }, + "ReasoningPreview": { + "type": "object", + "properties": { + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReasoningOption" + } + }, + "effectiveLevel": { + "type": "string", + "enum": [ + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + }, + "required": [ + "options", + "effectiveLevel" + ] + }, + "ReasoningOption": { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": [ + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ] + }, + "label": { + "type": "string" + } + }, + "required": [ + "value", + "label" + ] + }, "Model": { "type": "object", "properties": { @@ -5008,9 +5523,9 @@ } } }, - "/v1/push/devices/{installationId}/presence": { + "/v1/chat-attention/views/{viewId}": { "put": { - "operationId": "putPushPresence", + "operationId": "putChatAttentionView", "security": [ { "BearerAuth": [] @@ -5023,10 +5538,10 @@ { "schema": { "type": "string", - "format": "uuid" + "minLength": 1 }, "required": true, - "name": "installationId", + "name": "viewId", "in": "path" } ], @@ -5037,20 +5552,32 @@ "schema": { "type": "object", "properties": { - "active": { - "type": "boolean" - }, - "agentId": { + "chat": { "type": [ - "string", + "object", "null" ], - "format": "uuid" + "properties": { + "kind": { + "type": "string", + "enum": [ + "bot", + "group" + ] + }, + "id": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "kind", + "id" + ] } }, "required": [ - "active", - "agentId" + "chat" ] } } @@ -5143,10 +5670,9 @@ } } }, - "/v1/admin/users": { - "get": { - "operationId": "listUsers", - "description": "Every account on the server, oldest first. Admins only.", + "/v1/chat-attention/seen": { + "post": { + "operationId": "postChatAttentionSeen", "security": [ { "BearerAuth": [] @@ -5155,29 +5681,173 @@ "SessionCookie": [] } ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "users": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AdminUser" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chat": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "bot", + "group" + ] + }, + "id": { + "type": "string", + "minLength": 1 } - } + }, + "required": [ + "kind", + "id" + ] }, - "required": [ - "users" - ] - } + "eventIds": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1, + "maxItems": 100 + } + }, + "required": [ + "chat", + "eventIds" + ] } } - }, - "400": { + } + }, + "responses": { + "204": { + "description": "Success, no response body" + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/admin/users": { + "get": { + "operationId": "listUsers", + "description": "Every account on the server, oldest first. Admins only.", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdminUser" + } + } + }, + "required": [ + "users" + ] + } + } + } + }, + "400": { "description": "Invalid request or operation", "content": { "application/json": { @@ -7111,7 +7781,7 @@ "null" ], "maxLength": 64, - "description": "The name callers hear; null uses the bot's name." + "description": "The caller name sent to the telephone system; null uses the bot's name." }, "callsOwner": { "type": "boolean" @@ -7362,7 +8032,7 @@ "null" ], "maxLength": 64, - "description": "The name callers hear; null uses the bot's name." + "description": "The caller name sent to the telephone system; null uses the bot's name." }, "callsOwner": { "type": "boolean" @@ -7436,7 +8106,7 @@ "null" ], "maxLength": 64, - "description": "The name callers hear; null uses the bot's name." + "description": "The caller name sent to the telephone system; null uses the bot's name." }, "callsOwner": { "type": "boolean" @@ -12877,21 +13547,1024 @@ } } } - }, + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/Agent" + }, + { + "type": "null" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "delete": { + "operationId": "deleteAgent", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + } + ], + "responses": { + "204": { + "description": "Success, no response body" + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/duplicate": { + "post": { + "operationId": "duplicateAgent", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + } + ], + "responses": { + "201": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/Agent" + }, + { + "type": "null" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/chat": { + "get": { + "operationId": "getChat", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "required": false, + "name": "limit", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChatSnapshot" + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/chat/history": { + "get": { + "operationId": "getChatHistory", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "required": false, + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TranscriptPage" + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/coding-jobs": { + "get": { + "operationId": "listCodingJobs", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CodingJobs" + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/coding-jobs/{name}/answer": { + "post": { + "operationId": "answerCodingJob", + "description": "Answers the coding job's open question, which resumes the job. 409 when the job no longer waits on that question.", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + }, + { + "schema": { + "type": "string" + }, + "required": true, + "name": "name", + "in": "path" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "questionId": { + "type": "string", + "minLength": 1 + }, + "text": { + "type": "string", + "minLength": 1, + "maxLength": 32000 + } + }, + "required": [ + "questionId", + "text" + ] + } + } + } + }, + "responses": { + "204": { + "description": "Success, no response body" + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/coding-jobs/{name}/history": { + "get": { + "operationId": "getCodingJobHistory", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + }, + { + "schema": { + "type": "string" + }, + "required": true, + "name": "name", + "in": "path" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "required": false, + "name": "before", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobHistoryPage" + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v1/agents/{id}/desktop-jobs": { + "get": { + "operationId": "listDesktopJobs", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "required": true, + "name": "id", + "in": "path" + } + ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/Agent" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/DesktopJobs" } } } @@ -12977,9 +14650,11 @@ } } } - }, - "delete": { - "operationId": "deleteAgent", + } + }, + "/v1/agents/{id}/desktop/control": { + "get": { + "operationId": "getDesktopControl", "security": [ { "BearerAuth": [] @@ -12999,8 +14674,15 @@ } ], "responses": { - "204": { - "description": "Success, no response body" + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DesktopControl" + } + } + } }, "400": { "description": "Invalid request or operation", @@ -13083,11 +14765,10 @@ } } } - } - }, - "/v1/agents/{id}/duplicate": { - "post": { - "operationId": "duplicateAgent", + }, + "put": { + "operationId": "putDesktopControl", + "description": "Take control of the bot desktop (holder owner) or hand it back (holder bot). 409 when the bot has no bot desktop.", "security": [ { "BearerAuth": [] @@ -13106,20 +14787,35 @@ "in": "path" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "holder": { + "type": "string", + "enum": [ + "bot", + "owner" + ] + } + }, + "required": [ + "holder" + ] + } + } + } + }, "responses": { - "201": { + "200": { "description": "Success", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/Agent" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/DesktopControl" } } } @@ -13207,9 +14903,18 @@ } } }, - "/v1/agents/{id}/chat": { + "/v1/agents/{id}/desktop/events": { "get": { - "operationId": "getChat", + "operationId": "streamDesktopEvents", + "x-sse-events": { + "control": { + "$ref": "#/components/schemas/DesktopControl" + }, + "heartbeat": { + "$ref": "#/components/schemas/HeartbeatEvent" + } + }, + "description": "Server-sent events. A control event carries the DesktopControl JSON object in data, once on connect and on every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header.", "security": [ { "BearerAuth": [] @@ -13226,25 +14931,15 @@ "required": true, "name": "id", "in": "path" - }, - { - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 200 - }, - "required": false, - "name": "limit", - "in": "query" } ], "responses": { "200": { - "description": "Success", + "description": "SSE stream, not a JSON array", "content": { - "application/json": { + "text/event-stream": { "schema": { - "$ref": "#/components/schemas/ChatSnapshot" + "type": "string" } } } @@ -13332,9 +15027,9 @@ } } }, - "/v1/agents/{id}/chat/history": { + "/v1/agents/{id}/desktop/status": { "get": { - "operationId": "getChatHistory", + "operationId": "getDesktopStatus", "security": [ { "BearerAuth": [] @@ -13351,26 +15046,6 @@ "required": true, "name": "id", "in": "path" - }, - { - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 200 - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "required": false, - "name": "before", - "in": "query" } ], "responses": { @@ -13379,7 +15054,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TranscriptPage" + "$ref": "#/components/schemas/DesktopStatus" } } } @@ -13467,9 +15142,10 @@ } } }, - "/v1/agents/{id}/coding-jobs": { - "get": { - "operationId": "listCodingJobs", + "/v1/agents/{id}/desktop/viewer": { + "post": { + "operationId": "createDesktopViewer", + "description": "Issue a single-use viewer link for the bot desktop. The page and its WebSocket live outside /v1 and need no Authorization header: the link is the credential. With passive=true the link is watch-only: it neither boots the bot's machine nor keeps it awake, and its connection ends when the machine stops. 409 when the bot has no bot desktop.", "security": [ { "BearerAuth": [] @@ -13486,15 +15162,23 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string" + }, + "required": false, + "name": "passive", + "in": "query" } ], "responses": { - "200": { + "201": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CodingJobs" + "$ref": "#/components/schemas/DesktopViewer" } } } @@ -13582,10 +15266,9 @@ } } }, - "/v1/agents/{id}/coding-jobs/{name}/answer": { - "post": { - "operationId": "answerCodingJob", - "description": "Answers the coding job's open question, which resumes the job. 409 when the job no longer waits on that question.", + "/v1/agents/{id}/desktop-jobs/{name}/history": { + "get": { + "operationId": "getDesktopJobHistory", "security": [ { "BearerAuth": [] @@ -13610,36 +15293,38 @@ "required": true, "name": "name", "in": "path" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "required": false, + "name": "limit", + "in": "query" + }, + { + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "required": false, + "name": "before", + "in": "query" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "questionId": { - "type": "string", - "minLength": 1 - }, - "text": { - "type": "string", - "minLength": 1, - "maxLength": 32000 - } - }, - "required": [ - "questionId", - "text" - ] + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobHistoryPage" + } } } - } - }, - "responses": { - "204": { - "description": "Success, no response body" }, "400": { "description": "Invalid request or operation", @@ -13724,9 +15409,9 @@ } } }, - "/v1/agents/{id}/coding-jobs/{name}/history": { - "get": { - "operationId": "getCodingJobHistory", + "/v1/agents/{id}/messages": { + "post": { + "operationId": "sendMessage", "security": [ { "BearerAuth": [] @@ -13743,43 +15428,59 @@ "required": true, "name": "id", "in": "path" - }, - { - "schema": { - "type": "string" - }, - "required": true, - "name": "name", - "in": "path" - }, - { - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 200 - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "required": false, - "name": "before", - "in": "query" } - ], + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "type": "string", + "maxLength": 32000 + }, + "requestId": { + "type": "string", + "format": "uuid" + }, + "replyTo": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "files": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 8, + "default": [] + }, + "timezone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + }, + "required": [ + "content", + "requestId" + ], + "additionalProperties": false + } + } + } + }, "responses": { - "200": { + "202": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TranscriptPage" + "$ref": "#/components/schemas/Execution" } } } @@ -13867,9 +15568,9 @@ } } }, - "/v1/agents/{id}/desktop-jobs": { - "get": { - "operationId": "listDesktopJobs", + "/v1/agents/{id}/files": { + "post": { + "operationId": "uploadFile", "security": [ { "BearerAuth": [] @@ -13886,15 +15587,44 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true, + "name": "x-file-name", + "in": "header" + }, + { + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true, + "name": "content-type", + "in": "header" } ], + "requestBody": { + "required": true, + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, "responses": { - "200": { + "201": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DesktopJobs" + "$ref": "#/components/schemas/UploadFile" } } } @@ -13980,11 +15710,9 @@ } } } - } - }, - "/v1/agents/{id}/desktop/control": { + }, "get": { - "operationId": "getDesktopControl", + "operationId": "listFiles", "security": [ { "BearerAuth": [] @@ -14001,6 +15729,26 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": false, + "name": "before", + "in": "query" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200, + "default": 50 + }, + "required": false, + "name": "limit", + "in": "query" } ], "responses": { @@ -14009,7 +15757,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DesktopControl" + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryFile" + } } } } @@ -14095,10 +15846,11 @@ } } } - }, - "put": { - "operationId": "putDesktopControl", - "description": "Take control of the bot desktop (holder owner) or hand it back (holder bot). 409 when the bot has no bot desktop.", + } + }, + "/v1/agents/{id}/files/{fileId}": { + "get": { + "operationId": "getFile", "security": [ { "BearerAuth": [] @@ -14115,37 +15867,25 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "fileId", + "in": "path" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "holder": { - "type": "string", - "enum": [ - "bot", - "owner" - ] - } - }, - "required": [ - "holder" - ] - } - } - } - }, "responses": { "200": { - "description": "Success", + "description": "File bytes with safe download headers", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/DesktopControl" + "type": "string", + "format": "binary" } } } @@ -14231,20 +15971,9 @@ } } } - } - }, - "/v1/agents/{id}/desktop/events": { - "get": { - "operationId": "streamDesktopEvents", - "x-sse-events": { - "control": { - "$ref": "#/components/schemas/DesktopControl" - }, - "heartbeat": { - "$ref": "#/components/schemas/HeartbeatEvent" - } - }, - "description": "Server-sent events. A control event carries the DesktopControl JSON object in data, once on connect and on every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header.", + }, + "delete": { + "operationId": "deleteFile", "security": [ { "BearerAuth": [] @@ -14261,18 +15990,20 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "fileId", + "in": "path" } ], "responses": { - "200": { - "description": "SSE stream, not a JSON array", - "content": { - "text/event-stream": { - "schema": { - "type": "string" - } - } - } + "204": { + "description": "Success, no response body" }, "400": { "description": "Invalid request or operation", @@ -14357,9 +16088,9 @@ } } }, - "/v1/agents/{id}/desktop/status": { - "get": { - "operationId": "getDesktopStatus", + "/v1/group-chats/{id}/files": { + "post": { + "operationId": "uploadGroupFile", "security": [ { "BearerAuth": [] @@ -14376,15 +16107,44 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true, + "name": "x-file-name", + "in": "header" + }, + { + "schema": { + "type": "string", + "minLength": 1 + }, + "required": true, + "name": "content-type", + "in": "header" } ], + "requestBody": { + "required": true, + "content": { + "*/*": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, "responses": { - "200": { + "201": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DesktopStatus" + "$ref": "#/components/schemas/UploadFile" } } } @@ -14470,12 +16230,9 @@ } } } - } - }, - "/v1/agents/{id}/desktop/viewer": { - "post": { - "operationId": "createDesktopViewer", - "description": "Issue a single-use viewer link for the bot desktop. The page and its WebSocket live outside /v1 and need no Authorization header: the link is the credential. With passive=true the link is watch-only: it neither boots the bot's machine nor keeps it awake, and its connection ends when the machine stops. 409 when the bot has no bot desktop.", + }, + "get": { + "operationId": "listGroupFiles", "security": [ { "BearerAuth": [] @@ -14495,20 +16252,35 @@ }, { "schema": { - "type": "string" + "type": "string", + "format": "uuid" }, "required": false, - "name": "passive", + "name": "before", + "in": "query" + }, + { + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200, + "default": 50 + }, + "required": false, + "name": "limit", "in": "query" } ], "responses": { - "201": { + "200": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DesktopViewer" + "type": "array", + "items": { + "$ref": "#/components/schemas/LibraryFile" + } } } } @@ -14596,9 +16368,9 @@ } } }, - "/v1/agents/{id}/desktop-jobs/{name}/history": { + "/v1/group-chats/{id}/files/{fileId}": { "get": { - "operationId": "getDesktopJobHistory", + "operationId": "getGroupFile", "security": [ { "BearerAuth": [] @@ -14618,40 +16390,22 @@ }, { "schema": { - "type": "string" + "type": "string", + "format": "uuid" }, "required": true, - "name": "name", + "name": "fileId", "in": "path" - }, - { - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 200 - }, - "required": false, - "name": "limit", - "in": "query" - }, - { - "schema": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "required": false, - "name": "before", - "in": "query" } ], "responses": { "200": { - "description": "Success", + "description": "File bytes with safe download headers", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/TranscriptPage" + "type": "string", + "format": "binary" } } } @@ -14737,11 +16491,9 @@ } } } - } - }, - "/v1/agents/{id}/messages": { - "post": { - "operationId": "sendMessage", + }, + "delete": { + "operationId": "deleteGroupFile", "security": [ { "BearerAuth": [] @@ -14758,82 +16510,20 @@ "required": true, "name": "id", "in": "path" + }, + { + "schema": { + "type": "string", + "format": "uuid" + }, + "required": true, + "name": "fileId", + "in": "path" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "content": { - "type": "string", - "maxLength": 32000 - }, - "requestId": { - "type": "string", - "format": "uuid" - }, - "replyTo": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "attachments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "mimeType": { - "type": "string", - "minLength": 1, - "maxLength": 100 - }, - "data": { - "type": "string", - "minLength": 1, - "pattern": "^[A-Za-z0-9+/]*={0,2}$" - } - }, - "required": [ - "name", - "mimeType", - "data" - ] - }, - "maxItems": 8, - "default": [] - }, - "timezone": { - "type": "string", - "minLength": 1, - "maxLength": 100 - } - }, - "required": [ - "content", - "requestId" - ] - } - } - } - }, "responses": { - "202": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Execution" - } - } - } + "204": { + "description": "Success, no response body" }, "400": { "description": "Invalid request or operation", @@ -16319,186 +18009,12 @@ } ], "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TranscriptPage" - } - } - } - }, - "400": { - "description": "Invalid request or operation", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "401": { - "description": "Missing, expired, or invalid account session", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "Resource not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "405": { - "description": "Resource is read-only", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "409": { - "description": "Conflicting request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "413": { - "description": "Request body exceeds the size limit", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, - "503": { - "description": "Service unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - } - } - } - }, - "/v1/group-chats/{id}/messages": { - "post": { - "operationId": "sendGroupMessage", - "security": [ - { - "BearerAuth": [] - }, - { - "SessionCookie": [] - } - ], - "parameters": [ - { - "schema": { - "type": "string" - }, - "required": true, - "name": "id", - "in": "path" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "content": { - "type": "string", - "maxLength": 32000 - }, - "requestId": { - "type": "string", - "format": "uuid" - }, - "replyTo": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "attachments": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "mimeType": { - "type": "string", - "minLength": 1, - "maxLength": 100 - }, - "data": { - "type": "string", - "minLength": 1, - "pattern": "^[A-Za-z0-9+/]*={0,2}$" - } - }, - "required": [ - "name", - "mimeType", - "data" - ] - }, - "maxItems": 8, - "default": [] - } - }, - "required": [ - "content", - "requestId" - ] - } - } - } - }, - "responses": { - "201": { + "200": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GroupMessageReceipt" + "$ref": "#/components/schemas/TranscriptPage" } } } @@ -16586,9 +18102,9 @@ } } }, - "/v1/group-chats/{id}/attachments/{entryId}/{index}": { - "get": { - "operationId": "getGroupAttachment", + "/v1/group-chats/{id}/messages": { + "post": { + "operationId": "sendGroupMessage", "security": [ { "BearerAuth": [] @@ -16605,45 +18121,54 @@ "required": true, "name": "id", "in": "path" - }, - { - "schema": { - "type": "string" - }, - "required": true, - "name": "entryId", - "in": "path" - }, - { - "schema": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "maximum": 7 - }, - "required": true, - "name": "index", - "in": "path" } ], - "responses": { - "200": { - "description": "Attachment bytes; Content-Type identifies the image or text format", - "headers": { - "Cache-Control": { - "schema": { - "type": "string" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "type": "string", + "maxLength": 32000 + }, + "requestId": { + "type": "string", + "format": "uuid" + }, + "replyTo": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "files": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "maxItems": 8, + "default": [] + } }, - "description": "private, max-age=31536000, immutable" + "required": [ + "content", + "requestId" + ], + "additionalProperties": false } - }, + } + } + }, + "responses": { + "201": { + "description": "Success", "content": { - "*/*": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/GroupMessageReceipt" } } } @@ -23419,17 +24944,210 @@ "name": "agentId", "in": "query" } - ], + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Schedule" + } + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "post": { + "operationId": "createSchedule", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "agentId": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 200 + }, + "kind": { + "type": "string", + "enum": [ + "prompt", + "script" + ], + "default": "prompt" + }, + "prompt": { + "type": "string", + "maxLength": 32000, + "default": "" + }, + "command": { + "type": [ + "string", + "null" + ], + "maxLength": 8000, + "default": null + }, + "timeoutSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 3600, + "default": 600 + }, + "notify": { + "type": "boolean", + "default": true + }, + "cron": { + "type": [ + "string", + "null" + ], + "maxLength": 100, + "default": null + }, + "timezone": { + "type": "string", + "maxLength": 100, + "default": "UTC" + }, + "runAt": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "default": null + }, + "eventSourceId": { + "type": [ + "string", + "null" + ], + "minLength": 1, + "maxLength": 200, + "default": null + }, + "enabled": { + "type": "boolean", + "default": true + } + }, + "required": [ + "agentId", + "name" + ] + } + } + } + }, "responses": { - "200": { + "201": { "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Schedule" - } + "$ref": "#/components/schemas/Schedule" } } } @@ -23454,6 +25172,16 @@ } } }, + "403": { + "description": "Script tasks need coding jobs and must stay with their creator", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, "404": { "description": "Resource not found", "content": { @@ -23515,9 +25243,11 @@ } } } - }, + } + }, + "/v1/schedules/preview": { "post": { - "operationId": "createSchedule", + "operationId": "previewSchedule", "security": [ { "BearerAuth": [] @@ -23533,96 +25263,46 @@ "schema": { "type": "object", "properties": { - "agentId": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string", - "minLength": 1, - "maxLength": 200 - }, - "kind": { - "type": "string", - "enum": [ - "prompt", - "script" - ], - "default": "prompt" - }, - "prompt": { - "type": "string", - "maxLength": 32000, - "default": "" - }, - "command": { - "type": [ - "string", - "null" - ], - "maxLength": 8000, - "default": null - }, - "timeoutSeconds": { - "type": "integer", - "minimum": 1, - "maximum": 3600, - "default": 600 - }, - "notify": { - "type": "boolean", - "default": true - }, "cron": { "type": [ "string", "null" ], - "maxLength": 100, - "default": null - }, - "timezone": { - "type": "string", - "maxLength": 100, - "default": "UTC" + "maxLength": 100 }, "runAt": { "type": [ "string", "null" ], - "format": "date-time", - "default": null + "format": "date-time" }, "eventSourceId": { "type": [ "string", "null" ], - "minLength": 1, - "maxLength": 200, - "default": null + "maxLength": 200 }, - "enabled": { - "type": "boolean", - "default": true + "timezone": { + "type": "string", + "maxLength": 100 } }, "required": [ - "agentId", - "name" + "timezone" ] } } } }, "responses": { - "201": { + "200": { "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Schedule" + "$ref": "#/components/schemas/SchedulePreview" } } } @@ -23647,16 +25327,6 @@ } } }, - "403": { - "description": "Script tasks need coding jobs and must stay with their creator", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - } - }, "404": { "description": "Resource not found", "content": { @@ -24668,6 +26338,148 @@ } } }, + "/v1/reasoning/preview": { + "post": { + "operationId": "previewReasoning", + "security": [ + { + "BearerAuth": [] + }, + { + "SessionCookie": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "maxLength": 80 + }, + "model": { + "type": "string", + "maxLength": 200 + }, + "thinkingLevel": { + "type": "string", + "enum": [ + "off", + "minimal", + "low", + "medium", + "high", + "xhigh", + "max" + ], + "default": "off" + } + }, + "required": [ + "provider", + "model" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReasoningPreview" + } + } + } + }, + "400": { + "description": "Invalid request or operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "401": { + "description": "Missing, expired, or invalid account session", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "405": { + "description": "Resource is read-only", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "409": { + "description": "Conflicting request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "413": { + "description": "Request body exceeds the size limit", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, "/v1/models": { "get": { "operationId": "listModels", diff --git a/apfelkern/Sources/BotAvatar/AutomationForm.swift b/apfelkern/Sources/BotAvatar/AutomationForm.swift index 87105d0..c0dabc0 100644 --- a/apfelkern/Sources/BotAvatar/AutomationForm.swift +++ b/apfelkern/Sources/BotAvatar/AutomationForm.swift @@ -11,10 +11,13 @@ public struct AutomationFormSections: View { let sourcesLoaded: Bool /// Where sources are added: the web client's Event relay settings. let eventRelayURL: URL? + /// The server's preview of the trigger, and how to ask for it again once the trigger changes. + let preview: AutomationPreview? + let loadPreview: () async -> Void public init( draft: Binding, agents: [Agent], capabilities: ServerCapabilities?, sources: [EventSource], - sourcesLoaded: Bool, eventRelayURL: URL? + sourcesLoaded: Bool, eventRelayURL: URL?, preview: AutomationPreview?, loadPreview: @escaping () async -> Void ) { _draft = draft self.agents = agents @@ -22,6 +25,8 @@ public struct AutomationFormSections: View { self.sources = sources self.sourcesLoaded = sourcesLoaded self.eventRelayURL = eventRelayURL + self.preview = preview + self.loadPreview = loadPreview } private func canScript(_ agentID: String) -> Bool { @@ -52,7 +57,8 @@ public struct AutomationFormSections: View { } if draft.kind == .script { scriptSection } else { promptSection } AutomationWhenSection( - draft: $draft, sources: sources, sourcesLoaded: sourcesLoaded, eventRelayURL: eventRelayURL) + draft: $draft, sources: sources, sourcesLoaded: sourcesLoaded, eventRelayURL: eventRelayURL, preview: preview) + .task(id: [AnyHashable(draft.id), AnyHashable(draft.previewRequest)]) { await loadPreview() } Section { Toggle("Enabled", isOn: $draft.enabled) } @@ -108,6 +114,7 @@ private struct AutomationWhenSection: View { let sources: [EventSource] let sourcesLoaded: Bool let eventRelayURL: URL? + let preview: AutomationPreview? var body: some View { Section { @@ -120,7 +127,7 @@ private struct AutomationWhenSection: View { } header: { Text("When") } footer: { - if let preview = draft.preview() { + if let preview { Text(preview.text).foregroundStyle(preview.isProblem ? AnyShapeStyle(.red) : AnyShapeStyle(.secondary)) } } @@ -160,7 +167,9 @@ private struct AutomationWhenSection: View { .onChange(of: draft.cron) { _, cron in if cron.count > AutomationLimits.cron { draft.cron = String(cron.prefix(AutomationLimits.cron)) } } - Text(cronPhrase(draft.cron, timezone: draft.timezone)).font(.caption).foregroundStyle(.secondary) + if let description = preview?.description.nilIfEmpty { + Text(description).font(.caption).foregroundStyle(.secondary) + } default: if let recurrence = draft.recurrence { RecurrenceFields(recurrence: recurrence, draft: $draft) } } diff --git a/apfelkern/Sources/BotAvatar/AutomationsPage.swift b/apfelkern/Sources/BotAvatar/AutomationsPage.swift index 2e51eb0..1dccb63 100644 --- a/apfelkern/Sources/BotAvatar/AutomationsPage.swift +++ b/apfelkern/Sources/BotAvatar/AutomationsPage.swift @@ -5,7 +5,6 @@ import SwiftUI public struct AutomationsPage: View { @Bindable var board: AutomationBoard let agents: [Agent] - let sources: [EventSource] let client: APIClient? let onCreate: () -> Void let onRun: (Schedule) -> Void @@ -15,12 +14,11 @@ public struct AutomationsPage: View { @State private var output: AutomationRun? public init( - board: AutomationBoard, agents: [Agent], sources: [EventSource], client: APIClient?, + board: AutomationBoard, agents: [Agent], client: APIClient?, onCreate: @escaping () -> Void, onRun: @escaping (Schedule) -> Void, onOpenBot: @escaping (String) -> Void ) { self.board = board self.agents = agents - self.sources = sources self.client = client self.onCreate = onCreate self.onRun = onRun @@ -44,6 +42,9 @@ public struct AutomationsPage: View { } } .padding(.top, 8) + .task(id: [client?.baseURL ?? "", client?.token ?? ""]) { + if let client { await board.follow(client: client) } + } .confirmationDialog( "Delete \(deleting?.name ?? "")?", isPresented: Binding(get: { deleting != nil }, set: { if !$0 { deleting = nil } }), @@ -77,7 +78,7 @@ public struct AutomationsPage: View { Form { ForEach(board.shown) { schedule in AutomationRow( - schedule: schedule, bot: agent(schedule.agentId), creator: creator(of: schedule), sources: sources, + schedule: schedule, bot: agent(schedule.agentId), creator: creator(of: schedule), error: board.errors[schedule.id], isPending: board.isPending(schedule.id), isStarting: board.starting.contains(schedule.id), edit: { board.edit(schedule) }, run: { onRun(schedule) }, toggle: { @@ -144,7 +145,6 @@ private struct AutomationRow: View { let schedule: Schedule let bot: Agent? let creator: Agent? - let sources: [EventSource] let error: String? let isPending: Bool let isStarting: Bool @@ -190,10 +190,10 @@ private struct AutomationRow: View { } } Text(owner).font(.caption).foregroundStyle(.secondary).lineLimit(1) - Text(cadence(schedule, sources: sources)).font(.caption).foregroundStyle(.secondary) + Text(schedule.description).font(.caption).foregroundStyle(.secondary) HStack(spacing: 8) { status - Text("Next run: \(nextRunLabel(schedule))").foregroundStyle(.secondary) + Text("Next run: \(schedule.nextRunLabel)").foregroundStyle(.secondary) } .font(.caption) if let error { diff --git a/apfelkern/Sources/BotAvatar/BotFormFields.swift b/apfelkern/Sources/BotAvatar/BotFormFields.swift index 8ccc6f9..6c0b2f3 100644 --- a/apfelkern/Sources/BotAvatar/BotFormFields.swift +++ b/apfelkern/Sources/BotAvatar/BotFormFields.swift @@ -1,24 +1,21 @@ import apfelkern import SwiftUI -/// The bot form's reasoning level, limited to what the model supports and hidden with no choice to make. +/// The bot form's reasoning level, as the server's preview offers it for the model, and hidden with no choice +/// to make or no preview. The picker shows the level a turn runs at. public struct ReasoningField: View { - let levels: [ThinkingLevel] + let preview: ReasoningPreview? @Binding var thinking: String - public init(levels: [ThinkingLevel], thinking: Binding) { - self.levels = levels + public init(preview: ReasoningPreview?, thinking: Binding) { + self.preview = preview _thinking = thinking } - private var level: ThinkingLevel { - (ThinkingLevel(rawValue: thinking) ?? .off).clamped(to: levels) - } - public var body: some View { - if levels.count > 1 { - Picker("Reasoning", selection: Binding(get: { level }, set: { thinking = $0.rawValue })) { - ForEach(levels) { Text($0.title).tag($0) } + if let preview, preview.options.count > 1 { + Picker("Reasoning", selection: Binding(get: { preview.effectiveLevel }, set: { thinking = $0.rawValue })) { + ForEach(preview.options) { Text($0.label).tag($0.level) } } } } diff --git a/apfelkern/Sources/BotAvatar/ReasoningControl.swift b/apfelkern/Sources/BotAvatar/ReasoningControl.swift index acf925b..29aeff7 100644 --- a/apfelkern/Sources/BotAvatar/ReasoningControl.swift +++ b/apfelkern/Sources/BotAvatar/ReasoningControl.swift @@ -1,7 +1,7 @@ import apfelkern import SwiftUI -/// The composer's reasoning level, offered when the bot's model takes at least two. +/// The composer's reasoning level, offered when the server says the bot's model takes at least two. public struct ReasoningControl: View { let board: ReasoningBoard let bot: Agent @@ -18,23 +18,27 @@ public struct ReasoningControl: View { public var body: some View { // A ZStack, because a Group would run the task on each branch and on none while hidden. ZStack { - let levels = board.levels(of: bot) - if levels.count >= 2 { menu(levels) } + if let preview = board.preview(of: bot), preview.options.count >= 2 { menu(preview) } } - .task(id: "\(bot.id) \(bot.provider ?? "")") { - if let client, let provider = bot.provider { await board.load(provider: provider, client: client) } + .task(id: previewInputs) { + if let client { await board.load(bot: bot, client: client) } } } - private func menu(_ levels: [ThinkingLevel]) -> some View { - let level = board.level(of: bot) - return Menu { - Picker("Reasoning", selection: Binding(get: { level }, set: { choose($0) })) { - ForEach(levels) { Text($0.title).tag($0) } + /// What the server's preview depends on, including the connection, whose previews a reset drops. + private var previewInputs: [String] { + [client?.baseURL ?? "", client?.token ?? "", bot.provider ?? "", bot.model ?? "", + bot.inference?.thinkingLevel ?? ""] + } + + private func menu(_ preview: ReasoningPreview) -> some View { + Menu { + Picker("Reasoning", selection: Binding(get: { preview.effectiveLevel }, set: { choose($0) })) { + ForEach(preview.options) { Text($0.label).tag($0.level) } } .pickerStyle(.inline) } label: { - label(level) + label(preview.label) } .menuStyle(.button) #if os(macOS) @@ -47,17 +51,17 @@ public struct ReasoningControl: View { .fixedSize() .disabled(board.saving.contains(bot.id)) .accessibilityLabel("Reasoning") - .accessibilityValue(level.title) + .accessibilityValue(preview.label) .help("Reasoning") } /// macOS draws its own indicator and keeps only the title of a menu's label. - @ViewBuilder private func label(_ level: ThinkingLevel) -> some View { + @ViewBuilder private func label(_ title: String) -> some View { #if os(macOS) - Text(level.title).font(.caption.weight(.medium)).lineLimit(1) + Text(title).font(.caption.weight(.medium)).lineLimit(1) #else HStack(spacing: 3) { - Text(level.title) + Text(title) Image(systemName: "chevron.up.chevron.down").imageScale(.small) } .font(.caption.weight(.medium)) diff --git a/apfelkern/Sources/apfelkern/APIClient+Agents.swift b/apfelkern/Sources/apfelkern/APIClient+Agents.swift index 8f4cdfb..74a85d7 100644 --- a/apfelkern/Sources/apfelkern/APIClient+Agents.swift +++ b/apfelkern/Sources/apfelkern/APIClient+Agents.swift @@ -1,4 +1,5 @@ import Foundation +import OpenAPIRuntime extension APIClient { public func agents() async throws -> [Agent] { @@ -160,27 +161,45 @@ extension APIClient { } public func codingJobHistory(_ agentID: String, name: String, before: String, limit: Int) - async throws -> ChatHistoryResponse { + async throws -> JobHistoryPage { try await invoke { - try ChatHistoryResponse(wire: await $0.getCodingJobHistory(.init( + try JobHistoryPage(wire: await $0.getCodingJobHistory(.init( path: .init(id: agentID, name: name), query: .init(limit: limit > 0 ? limit : nil, before: before.nilIfEmpty) )).ok.body.json) } } + /// Uploads a file into the bot's library and returns its ID, which a message then carries in `files`. + public func uploadFile(_ agentID: String, _ file: PendingAttachment) async throws -> String { + try await invoke(timeout: 120, headers: ["Content-Type": file.mimeType]) { + try await $0.uploadFile(.init( + path: .init(id: agentID), headers: .init(xFileName: file.name), + body: .any(HTTPBody(file.data)))).created.body.json.file.id + } + } + public func sendChatMessage( _ agentID: String, content: String, requestID: String, replyTo: String, - attachments: [OutgoingAttachment] = [], timezone: String = TimeZone.current.identifier + files: [String] = [], timezone: String = TimeZone.current.identifier ) async throws { let body = Operations.SendMessage.Input.Body.JsonPayload( - attachments: attachments.isEmpty ? nil : attachments, - content: content, replyTo: replyTo.nilIfEmpty, requestId: requestID, timezone: timezone) - try await invoke(timeout: attachments.isEmpty ? 20 : 120) { + content: content, files: files.isEmpty ? nil : files, replyTo: replyTo.nilIfEmpty, requestId: requestID, + timezone: timezone) + try await invoke(timeout: files.isEmpty ? 20 : 120) { _ = try await $0.sendMessage(.init(path: .init(id: agentID), body: .json(body))).accepted } } + /// A file from the bot's library, by the ID a transcript message lists. + public func file(_ agentID: String, fileID: String) async throws -> Data { + try await invoke(timeout: 120) { + let body = try await $0.getFile(.init(path: .init(id: agentID, fileId: fileID))).ok.body.binary + return try await Data(collecting: body, upTo: .max) + } + } + + /// An image from a transcript entry without a file ID, such as a desktop screenshot. public func attachment(_ agentID: String, entryID: String, index: Int) async throws -> Data { try await invoke { let body = try await $0.getAttachment(.init( diff --git a/apfelkern/Sources/apfelkern/APIClient+Integrations.swift b/apfelkern/Sources/apfelkern/APIClient+Integrations.swift index 2b26134..7f92ea6 100644 --- a/apfelkern/Sources/apfelkern/APIClient+Integrations.swift +++ b/apfelkern/Sources/apfelkern/APIClient+Integrations.swift @@ -19,6 +19,22 @@ extension APIClient { } } + /// The levels a model offers and the one a turn at `level` runs at. A model the server doesn't list + /// offers every level. + public func previewReasoning(provider: String, model: String, level: ThinkingLevel) async throws + -> ReasoningPreview { + try await invoke { + let preview = try await $0.previewReasoning(.init(body: .json(.init( + model: model, provider: provider, thinkingLevel: .init(rawValue: level.rawValue) + )))).ok.body.json + return ReasoningPreview( + options: preview.options.compactMap { option in + ThinkingLevel(rawValue: option.value.rawValue).map { ReasoningOption(level: $0, label: option.label) } + }, + effectiveLevel: ThinkingLevel(rawValue: preview.effectiveLevel.rawValue) ?? level) + } + } + public func mcpServers() async throws -> [MCPServer] { try await invoke { try await $0.listMcpServers(.init()).ok.body.json.map(MCPServer.init(wire:)) } } diff --git a/apfelkern/Sources/apfelkern/APIClient+Library.swift b/apfelkern/Sources/apfelkern/APIClient+Library.swift index 12320a7..78cec23 100644 --- a/apfelkern/Sources/apfelkern/APIClient+Library.swift +++ b/apfelkern/Sources/apfelkern/APIClient+Library.swift @@ -61,6 +61,18 @@ extension APIClient { } } + /// When a draft trigger would next run, or why it can't, in the server's words. + public func previewAutomation(_ request: AutomationPreviewRequest) async throws -> AutomationPreview { + try await invoke { + let preview = try await $0.previewSchedule(.init(body: .json(.init( + cron: request.cron, eventSourceId: request.eventSourceId, runAt: request.runAt, timezone: request.timezone + )))).ok.body.json + return AutomationPreview( + text: preview.text, isProblem: preview.isProblem, description: preview.description, + nextRunAt: preview.nextRunAt) + } + } + public func deleteSchedule(_ id: String) async throws { try await invoke { _ = try await $0.deleteSchedule(.init(path: .init(id: id))).noContent } } diff --git a/apfelkern/Sources/apfelkern/APIClient+Push.swift b/apfelkern/Sources/apfelkern/APIClient+Push.swift index 2e27832..3b06a36 100644 --- a/apfelkern/Sources/apfelkern/APIClient+Push.swift +++ b/apfelkern/Sources/apfelkern/APIClient+Push.swift @@ -83,11 +83,23 @@ extension APIClient { try await invoke { _ = try await $0.deletePushDevice(.init(path: .init(installationId: installationID))).noContent } } - public func pushPresence(_ installationID: String, active: Bool, agentId: String?, timeout: TimeInterval = 20) - async throws { - try await invoke(timeout: timeout, nullFields: agentId == nil ? ["agentId"] : []) { - _ = try await $0.putPushPresence(.init(path: .init(installationId: installationID), - body: .json(.init(active: active, agentId: agentId)))).noContent + /// Replaces what one view shows: a chat while it has the owner's attention, or nothing. + public func reportChatAttention(view viewID: String, chat: ChatAttentionChat?) async throws { + typealias Chat = Operations.PutChatAttentionView.Input.Body.JsonPayload.ChatPayload + let wire = chat.map { Chat(id: $0.id, kind: $0.kind == .bot ? .bot : .group) } + // An absent chat isn't a clear; the server needs an explicit null. + try await invoke(nullFields: chat == nil ? ["chat"] : []) { + _ = try await $0.putChatAttentionView(.init( + path: .init(viewId: viewID), body: .json(.init(chat: wire)))).noContent + } + } + + /// Records that the owner saw these replies, 1 to 100 distinct events of one chat. + public func markRepliesSeen(_ eventIDs: [String], in chat: ChatAttentionChat) async throws { + typealias Chat = Operations.PostChatAttentionSeen.Input.Body.JsonPayload.ChatPayload + let wire = Chat(id: chat.id, kind: chat.kind == .bot ? .bot : .group) + try await invoke { + _ = try await $0.postChatAttentionSeen(.init(body: .json(.init(chat: wire, eventIds: eventIDs)))).noContent } } } diff --git a/apfelkern/Sources/apfelkern/Attachments.swift b/apfelkern/Sources/apfelkern/Attachments.swift index 3d3a020..9f67aa2 100644 --- a/apfelkern/Sources/apfelkern/Attachments.swift +++ b/apfelkern/Sources/apfelkern/Attachments.swift @@ -13,9 +13,6 @@ public struct PendingAttachment: Identifiable, Hashable, Sendable { } public var isImage: Bool { mimeType.hasPrefix("image/") } - public var outgoing: OutgoingAttachment { - OutgoingAttachment(name: name, mimeType: mimeType, data: data.base64EncodedString()) - } } public enum AttachmentLimits { diff --git a/apfelkern/Sources/apfelkern/Automation.swift b/apfelkern/Sources/apfelkern/Automation.swift index 616b3d9..83515b4 100644 --- a/apfelkern/Sources/apfelkern/Automation.swift +++ b/apfelkern/Sources/apfelkern/Automation.swift @@ -53,21 +53,6 @@ public func listedAutomations(_ schedules: [Schedule]) -> [Schedule] { } } -/// When an automation next runs, close by in words; a dash when paused or finished. -public func nextRunLabel(_ schedule: Schedule, now: Date = .now) -> String { - guard schedule.enabled, let next = schedule.nextRunAt.flatMap(automationRunDate) else { return "—" } - let seconds = next.timeIntervalSince(now) - guard seconds < 86_400 else { - return next.formatted(.dateTime.weekday(.abbreviated).month(.abbreviated).day().hour().minute()) - } - let minutes = Int((seconds / 60).rounded()) - let formatter = RelativeDateTimeFormatter() - formatter.unitsStyle = .full - return formatter.localizedString( - from: minutes < 60 - ? DateComponents(minute: max(minutes, 0)) : DateComponents(hour: Int((Double(minutes) / 60).rounded()))) -} - public enum ScriptRunStatus: String, Codable, Hashable, Sendable { case running, succeeded, failed, interrupted case timedOut = "timed_out" diff --git a/apfelkern/Sources/apfelkern/AutomationBoard.swift b/apfelkern/Sources/apfelkern/AutomationBoard.swift index 9fe1381..c369e0b 100644 --- a/apfelkern/Sources/apfelkern/AutomationBoard.swift +++ b/apfelkern/Sources/apfelkern/AutomationBoard.swift @@ -29,6 +29,8 @@ public final class AutomationBoard { public private(set) var saveError = "" /// Failed saves waiting for the open sheet to close. private var returned: [(draft: AutomationDraft, error: String)] = [] + /// The server's preview of the open draft's trigger, and the draft and request it answered. + private var preview: (draft: UUID, request: AutomationPreviewRequest, value: AutomationPreview)? public var view = AutomationsView.automations public var filter = AutomationFilter.all @@ -55,6 +57,7 @@ public final class AutomationBoard { draft = nil saveError = "" returned = [] + preview = nil view = .automations filter = .all executions = [] @@ -132,6 +135,39 @@ public final class AutomationBoard { } } + /// Refreshes the list while it is on screen, so the server's next-run labels stay current. + public func follow(client: APIClient, every interval: Duration = .seconds(60)) async { + while !Task.isCancelled { + try? await Task.sleep(for: interval) + guard !Task.isCancelled else { return } + if view == .automations { refresh(client: client) } + } + } + + /// The preview of the open draft; nil while it loads, after it failed, or once the trigger changed. + public var draftPreview: AutomationPreview? { + guard let draft, let preview, preview.draft == draft.id, preview.request == draft.previewRequest else { return nil } + return preview.value + } + + public var draftPreviewProblem: String? { + guard let draft, !draft.hasUnchangedTrigger, let preview = draftPreview, preview.isProblem else { return nil } + return preview.text + } + + /// Asks the server about the open draft's trigger once it has held for `delay`. Cancelling the task, as + /// SwiftUI does when the trigger changes, drops the request; an answer for an earlier trigger, another + /// draft, or another connection is ignored. A failed request leaves no preview and saving still works. + public func loadPreview(client: APIClient, after delay: Duration = .milliseconds(250)) async { + guard let form = draft, draftPreview == nil else { return } + let (version, request) = (scope, form.previewRequest) + try? await Task.sleep(for: delay) + guard !Task.isCancelled, let loaded = try? await client.previewAutomation(request), !Task.isCancelled, + scope == version, draft?.id == form.id, draft?.previewRequest == request + else { return } + preview = (form.id, request, loaded) + } + /// Never replaces an open sheet: it may hold what the owner typed, or a save that came back. public func openNew(agentID: String) { guard draft == nil else { return } @@ -152,6 +188,7 @@ public final class AutomationBoard { public func closeDraft() { draft = nil saveError = "" + preview = nil if !returned.isEmpty { let next = returned.removeFirst() draft = next.draft @@ -167,14 +204,16 @@ public final class AutomationBoard { /// `failed` runs when the server refuses the save, which gives the draft back. public func saveDraft(client: APIClient, failed: @escaping @MainActor () -> Void = {}) { guard let form = draft else { return } - if let problem = form.problem { + // Without a preview the server checks the trigger as it saves. + let preview = draftPreview + if let problem = form.problem ?? draftPreviewProblem { saveError = problem return } let id = form.isNew ? "pending-schedule-" + UUID().uuidString : form.scheduleID guard pending[id] == nil else { return } let version = scope - pending[id] = form.provisional(id: id, replacing: loaded.first { $0.id == id }) + pending[id] = form.provisional(id: id, replacing: loaded.first { $0.id == id }, preview: preview) closeDraft() errors[id] = nil Task { @@ -217,6 +256,8 @@ public final class AutomationBoard { let id = schedule.id guard schedule.enabled != enabled, !isPending(id), var row = schedules.first(where: { $0.id == id }) else { return } row.enabled = enabled + row.timing = enabled ? row.description : "Paused · " + row.description + row.nextRunLabel = enabled ? "Saving…" : "—" pending[id] = row errors[id] = nil let version = scope diff --git a/apfelkern/Sources/apfelkern/AutomationCadence.swift b/apfelkern/Sources/apfelkern/AutomationCadence.swift deleted file mode 100644 index 4e91c04..0000000 --- a/apfelkern/Sources/apfelkern/AutomationCadence.swift +++ /dev/null @@ -1,71 +0,0 @@ -import Foundation - -/// When an automation runs: its event source, its cron shape in words, or its one time. -public func cadence(_ schedule: Schedule, sources: [EventSource] = [], now: Date = .now) -> String { - if let sourceID = schedule.eventSourceId { - return sources.first { $0.id == sourceID }.map { "On event · \($0.name)" } ?? "On event" - } - guard let cron = schedule.cron?.nilIfEmpty else { - guard let runAt = schedule.runAt, let date = automationRunDate(runAt) else { return "Once" } - let zone = schedule.timezone.flatMap(TimeZone.init(identifier:)) ?? .current - let when = date.formatted(Date.FormatStyle(date: .abbreviated, time: .shortened, timeZone: zone)) - return date < now && schedule.nextRunAt == nil ? "Ran \(when)" : "Once, \(when)" - } - return cronPhrase(cron, timezone: schedule.timezone) -} - -/// An automation's timing beside its switch, where a paused one says so. -public func automationTiming(_ schedule: Schedule, sources: [EventSource] = []) -> String { - (schedule.enabled ? "" : "Paused · ") + cadence(schedule, sources: sources) -} - -/// A cron expression in words for the shapes people use, or the expression itself. -public func cronPhrase(_ cron: String, timezone: String?) -> String { - let text = cron.trimmingCharacters(in: .whitespacesAndNewlines) - // Cron times are in the automation's own zone; name it when that isn't this device's. - let zone = timezone?.nilIfEmpty.flatMap { $0 == TimeZone.current.identifier ? nil : " (\($0))" } ?? "" - let fields = text.split(whereSeparator: \.isWhitespace).map(String.init) - if fields.count == 5, fields[0].hasPrefix("*/"), Array(fields[1...]) == ["*", "*", "*", "*"] { - return "Every \(fields[0].dropFirst(2)) minutes" - } - let named = ["MON-FRI": "1-5", "SAT,SUN": "0,6"] - let spelled = fields.count == 5 ? (fields[..<4] + [named[fields[4]] ?? fields[4]]).joined(separator: " ") : text - guard let recurrence = Recurrence(cron: spelled) else { return text + zone } - if recurrence.kind == .hourly { return "Every hour at :" + String(format: "%02d", recurrence.minute) } - return recurrence.phrase + zone -} - -extension Recurrence { - fileprivate var phrase: String { - let time = Calendar.current.date(from: DateComponents(hour: hour, minute: minute))? - .formatted(date: .omitted, time: .shortened) ?? "" - switch kind { - case .hourly: return "Every hour at :" + String(format: "%02d", minute) - case .daily: return "Every day at \(time)" - case .weekdays: return "Weekdays at \(time)" - case .monthly: return "Every month on day \(day) at \(time)" - case .weekly: - if Set(days) == [0, 6] { return "Weekends at \(time)" } - if let only = days.first, days.count == 1 { return "Every \(Calendar.current.weekdaySymbols[only]) at \(time)" } - let names = days.sorted { ($0 + 6) % 7 < ($1 + 6) % 7 }.map { Calendar.current.shortWeekdaySymbols[$0] } - return names.joined(separator: ", ") + " at \(time)" - } - } -} - -/// A run's day in the automation's zone, as "today at 09:00". -public func humanRun(_ date: Date, zone: TimeZone, now: Date = .now) -> String { - var calendar = Calendar(identifier: .gregorian) - calendar.timeZone = zone - let days = calendar.dateComponents( - [.day], from: calendar.startOfDay(for: now), to: calendar.startOfDay(for: date)).day ?? 0 - let time = date.formatted(Date.FormatStyle(date: .omitted, time: .shortened, timeZone: zone)) - let day: String - switch days { - case 0: day = "today" - case 1: day = "tomorrow" - case 2..<7: day = date.formatted(Date.FormatStyle(timeZone: zone).weekday(.wide)) - default: day = date.formatted(Date.FormatStyle(timeZone: zone).weekday(.abbreviated).day().month(.abbreviated)) - } - return "\(day) at \(time)" -} diff --git a/apfelkern/Sources/apfelkern/AutomationDraft.swift b/apfelkern/Sources/apfelkern/AutomationDraft.swift index 050029f..2113108 100644 --- a/apfelkern/Sources/apfelkern/AutomationDraft.swift +++ b/apfelkern/Sources/apfelkern/AutomationDraft.swift @@ -36,6 +36,7 @@ public struct AutomationDraft: Identifiable, Sendable { public var timezone = TimeZone.current.identifier public var onEvent = false public var eventSourceId = "" + private var savedTrigger: (request: AutomationPreviewRequest, runAt: String?)? public init(agentID: String) { scheduleID = "" @@ -63,10 +64,13 @@ public struct AutomationDraft: Identifiable, Sendable { timezone = schedule.timezone ?? timezone onEvent = schedule.eventSourceId != nil eventSourceId = schedule.eventSourceId ?? "" + savedTrigger = (previewRequest, schedule.runAt) } public var isNew: Bool { scheduleID.isEmpty } + var hasUnchangedTrigger: Bool { savedTrigger?.request == previewRequest } + public var when: AutomationWhen { get { guard repeats else { return .once } @@ -92,7 +96,7 @@ public struct AutomationDraft: Identifiable, Sendable { private func trimmed(_ text: String) -> String { text.trimmingCharacters(in: .whitespacesAndNewlines) } - /// Why the draft can't be saved; nil when it can. + /// Why the draft can't be saved; nil when it can. The server's preview checks the trigger and its zone. public var problem: String? { if agentID.isEmpty { return "Choose which bot runs this automation." } if kind == .prompt, trimmed(name).isEmpty || trimmed(prompt).isEmpty { @@ -103,9 +107,7 @@ public struct AutomationDraft: Identifiable, Sendable { guard let timeout = Int(trimmed(timeoutSeconds)), (1...AutomationLimits.maxTimeoutSeconds).contains(timeout) else { return "Timeout must be between 1 and \(AutomationLimits.maxTimeoutSeconds) seconds." } } - if onEvent { return eventSourceId.isEmpty ? "Choose an event source." : nil } - if repeats, trimmed(cron).isEmpty { return "Choose either a recurring cron or a one-time run time." } - return zone == nil ? "Choose a valid time zone." : nil + return nil } /// Exactly one is set, as the server requires. @@ -117,7 +119,9 @@ public struct AutomationDraft: Identifiable, Sendable { private var trigger: Trigger { if onEvent { return Trigger(eventSourceId: eventSourceId) } - return repeats ? Trigger(cron: trimmed(cron)) : Trigger(runAt: runDate.ISO8601Format()) + if repeats { return Trigger(cron: trimmed(cron)) } + let savedRunAt = savedTrigger.flatMap { $0.request.runAt == runDate ? $0.runAt : nil } + return Trigger(runAt: savedRunAt ?? runDate.ISO8601Format()) } private var timeout: Int { @@ -139,41 +143,57 @@ public struct AutomationDraft: Identifiable, Sendable { ] } - /// The row to show until the server answers. - public func provisional(id: String, replacing old: Schedule?, now: Date = .now) -> Schedule { + /// What the server previews: the trigger in its zone. + public var previewRequest: AutomationPreviewRequest { let trigger = trigger - let cronRun = trigger.cron.flatMap { cron in - zone.flatMap { CronExpression(cron)?.next(after: now, in: $0) } - } + return AutomationPreviewRequest( + cron: trigger.cron, runAt: trigger.runAt == nil ? nil : runDate, eventSourceId: trigger.eventSourceId, + timezone: trimmed(timezone)) + } + + /// The row to show until the server answers, with the next run the preview found, if any. + public func provisional(id: String, replacing old: Schedule?, preview: AutomationPreview? = nil) -> Schedule { + let trigger = trigger + let saving = "Saving…" return Schedule( id: id, agentId: agentID, name: trimmed(name), cron: trigger.cron, prompt: kind == .prompt ? trimmed(prompt) : "", kind: kind, command: kind == .script ? command : nil, timeoutSeconds: timeout, notify: notify, timezone: trimmed(timezone), runAt: trigger.runAt, eventSourceId: trigger.eventSourceId, enabled: enabled, - nextRunAt: trigger.runAt ?? cronRun?.ISO8601Format(), createdByAgentId: old?.createdByAgentId) + // A one-time run is its own next run, so the row doesn't read as finished before it is saved. + nextRunAt: trigger.runAt ?? trigger.cron.flatMap { _ in preview?.nextRunAt ?? old?.nextRunAt }, + createdByAgentId: old?.createdByAgentId, description: saving, timing: saving, nextRunLabel: saving) } +} - /// The line under the When section; nil for an event automation, which has no next run. - public func preview(now: Date = .now) -> AutomationPreview? { - guard !onEvent else { return nil } - guard let zone else { return AutomationPreview(text: "Choose a valid time zone.", isProblem: true) } - let zoneName = trimmed(timezone) - guard repeats else { - return runDate < now - ? AutomationPreview(text: "This time has passed.", isProblem: true) - : AutomationPreview(text: "Runs \(humanRun(runDate, zone: zone, now: now)) (\(zoneName))", isProblem: false) - } - guard let expression = CronExpression(cron) else { - return AutomationPreview(text: "The server checks this schedule when you save.", isProblem: false) - } - guard let run = expression.next(after: now, in: zone) else { - return AutomationPreview(text: "This schedule never runs.", isProblem: true) - } - return AutomationPreview(text: "Next run \(humanRun(run, zone: zone, now: now)) (\(zoneName))", isProblem: false) +/// A draft trigger the server previews; exactly one of `cron`, `runAt`, and `eventSourceId` is set. +public struct AutomationPreviewRequest: Hashable, Sendable { + public var cron: String? + public var runAt: Date? + /// Empty while an event automation has no source yet, which the preview names as the problem. + public var eventSourceId: String? + public var timezone: String + + public init(cron: String? = nil, runAt: Date? = nil, eventSourceId: String? = nil, timezone: String) { + self.cron = cron + self.runAt = runAt + self.eventSourceId = eventSourceId + self.timezone = timezone } } +/// The server's line under the When section: when the draft next runs, or why it can't. public struct AutomationPreview: Equatable, Sendable { public var text: String public var isProblem: Bool + /// The trigger in words, as the saved automation will describe it. + public var description: String + public var nextRunAt: String? + + public init(text: String, isProblem: Bool, description: String = "", nextRunAt: String? = nil) { + self.text = text + self.isProblem = isProblem + self.description = description + self.nextRunAt = nextRunAt + } } diff --git a/apfelkern/Sources/apfelkern/AutomationRecurrence.swift b/apfelkern/Sources/apfelkern/AutomationRecurrence.swift index 547a3dd..a188bcb 100644 --- a/apfelkern/Sources/apfelkern/AutomationRecurrence.swift +++ b/apfelkern/Sources/apfelkern/AutomationRecurrence.swift @@ -120,112 +120,3 @@ public enum AutomationWhen: String, CaseIterable, Identifiable, Sendable { var recurrenceKind: Recurrence.Kind? { Recurrence.Kind(rawValue: rawValue) } } - -/// A five-field cron expression for the next-run preview: lists, ranges, steps, and month and weekday names. -/// The server takes more than this, so nil means "can't say", not "invalid". -public struct CronExpression: Sendable { - private let minutes: [Int] - private let hours: [Int] - private let days: Set - private let months: Set - private let weekdays: Set - private let dayIsAny: Bool - private let weekdayIsAny: Bool - - private static let monthNames = [ - "JAN": 1, "FEB": 2, "MAR": 3, "APR": 4, "MAY": 5, "JUN": 6, - "JUL": 7, "AUG": 8, "SEP": 9, "OCT": 10, "NOV": 11, "DEC": 12 - ] - private static let dayNames = ["SUN": 0, "MON": 1, "TUE": 2, "WED": 3, "THU": 4, "FRI": 5, "SAT": 6] - /// The longest wait a matching date can need: February 29 across a skipped leap year. - private static let searchedDays = 366 * 9 - - public init?(_ text: String) { - let fields = text.split(whereSeparator: \.isWhitespace).map(String.init) - guard fields.count == 5, - let minutes = Self.values(fields[0], 0...59), - let hours = Self.values(fields[1], 0...23), - let days = Self.values(fields[2], 1...31), - let months = Self.values(fields[3], 1...12, names: Self.monthNames), - let weekdays = Self.values(fields[4], 0...7, names: Self.dayNames) - else { return nil } - self.minutes = minutes.sorted() - self.hours = hours.sorted() - self.days = days - self.months = months - self.weekdays = Set(weekdays.map { $0 % 7 }) - dayIsAny = days.count == 31 - weekdayIsAny = Set(weekdays.map { $0 % 7 }).count == 7 - } - - private static func values( - _ field: String, _ range: ClosedRange, names: [String: Int] = [:] - ) -> Set? { - var values = Set() - for part in field.split(separator: ",", omittingEmptySubsequences: false) { - let pieces = part.split(separator: "/", omittingEmptySubsequences: false) - guard pieces.count <= 2 else { return nil } - let step = pieces.count == 2 ? Int(pieces[1]) : 1 - guard let step, step > 0, let bounds = bounds(String(pieces[0]), range, names, stepped: pieces.count == 2) - else { return nil } - values.formUnion(stride(from: bounds.lowerBound, through: bounds.upperBound, by: step)) - } - return values.isEmpty ? nil : values - } - - private static func bounds( - _ text: String, _ range: ClosedRange, _ names: [String: Int], stepped: Bool - ) -> ClosedRange? { - if text == "*" || text == "?" { return range } - let value = { (part: Substring) -> Int? in - let number = names[part.uppercased()] ?? Int(part) - return number.flatMap { range.contains($0) ? $0 : nil } - } - let ends = text.split(separator: "-", omittingEmptySubsequences: false) - if ends.count == 2 { - guard let low = value(ends[0]), let high = value(ends[1]), low <= high else { return nil } - return low...high - } - guard ends.count == 1, let start = value(ends[0]) else { return nil } - return stepped ? start...range.upperBound : start...start - } - - /// The first run after a moment, or nil if the date never comes, like February 31. - public func next(after date: Date, in zone: TimeZone) -> Date? { - var calendar = Calendar(identifier: .gregorian) - calendar.timeZone = zone - let start = calendar.startOfDay(for: date) - for offset in 0.. Bool { - guard let month = parts.month, let day = parts.day, let weekday = parts.weekday, months.contains(month) - else { return false } - let (onDay, onWeekday) = (days.contains(day), weekdays.contains(weekday - 1)) - // Cron's rule: when both are set, either one matching is enough. - return dayIsAny || weekdayIsAny ? onDay && onWeekday : onDay || onWeekday - } - - private func firstTime(on parts: DateComponents, after date: Date, calendar: Calendar) -> Date? { - for hour in hours { - for minute in minutes { - var moment = parts - moment.weekday = nil - moment.hour = hour - moment.minute = minute - guard let run = calendar.date(from: moment), run > date, - // A time a clock change skips doesn't exist that day. - calendar.component(.hour, from: run) == hour, calendar.component(.minute, from: run) == minute - else { continue } - return run - } - } - return nil - } -} diff --git a/apfelkern/Sources/apfelkern/BotChatDelivery.swift b/apfelkern/Sources/apfelkern/BotChatDelivery.swift index 47eef1a..04b3e8e 100644 --- a/apfelkern/Sources/apfelkern/BotChatDelivery.swift +++ b/apfelkern/Sources/apfelkern/BotChatDelivery.swift @@ -20,6 +20,8 @@ public struct BotChatDelivery { private struct Pending { var send: Send var message: Message + /// Server file IDs for the attachments an attempt already uploaded, so a retry uploads only the rest. + var uploaded: [UUID: String] = [:] } private struct Chat { @@ -37,8 +39,7 @@ public struct BotChatDelivery { replyTo: send.replyTo.nilIfEmpty, replyPreview: send.replyPreview, timestamp: Int64(Date().timeIntervalSince1970 * 1000), attachments: send.attachments.map { - AttachmentInfo( - name: $0.name, mimeType: $0.mimeType, size: $0.data.count, kind: $0.isImage ? "image" : "file") + AttachmentInfo(name: $0.name, mimeType: $0.mimeType, size: $0.data.count) }, requestId: requestID, deliveryState: .sending ) @@ -66,13 +67,40 @@ public struct BotChatDelivery { } } - public mutating func fail(botID: String, requestID: String) -> Bool { + /// Marks a send failed. When the server rejected it because a file it carries left the library, the next retry + /// uploads every attachment again from the bytes the send kept; other failures keep the uploads. + public mutating func fail(botID: String, requestID: String, error: Error? = nil) -> Bool { guard let index = pendingIndex(botID: botID, requestID: requestID) else { return false } chats[botID]?.pending[index].message.deliveryState = .failed + if let error, Self.rejectsFiles(error) { chats[botID]?.pending[index].uploaded = [:] } clearPreview(botID: botID, requestID: requestID) return true } + /// The file ID an earlier attempt of this send uploaded for one of its attachments. + public func uploadedFile(_ attachment: UUID, botID: String, requestID: String) -> String? { + pendingIndex(botID: botID, requestID: requestID).flatMap { chats[botID]?.pending[$0].uploaded[attachment] } + } + + /// Keeps an upload for the send's retries; false once the send is no longer pending, so its delivery stops. + public mutating func recordUpload(_ fileID: String, for attachment: UUID, botID: String, requestID: String) + -> Bool { + guard let index = pendingIndex(botID: botID, requestID: requestID) else { return false } + chats[botID]?.pending[index].uploaded[attachment] = fileID + return true + } + + public func isPending(botID: String, requestID: String) -> Bool { + pendingIndex(botID: botID, requestID: requestID) != nil + } + + /// The server's answer to a message that lists a file deleted from, or never in, the chat's library. + static func rejectsFiles(_ error: Error) -> Bool { + guard let error = error as? APIError, error.statusCode == 400 else { return false } + let message = friendlyError(error) + return message.contains("File not found in this library") || message.contains(" was deleted from the library") + } + public mutating func reset() { chats.removeAll() } diff --git a/apfelkern/Sources/apfelkern/BotRequestBoard.swift b/apfelkern/Sources/apfelkern/BotRequestBoard.swift index 5f5b15b..c867bbf 100644 --- a/apfelkern/Sources/apfelkern/BotRequestBoard.swift +++ b/apfelkern/Sources/apfelkern/BotRequestBoard.swift @@ -52,6 +52,9 @@ public final class BotRequestBoard { requests[request.id] ?? request } + /// The server listed the request, so its card shows the server's state rather than the saved one. + public func isLoaded(_ id: String) -> Bool { requests[id] != nil } + public func decision(for id: String) -> BotRequestDecision { decisions[id] ?? BotRequestDecision() } diff --git a/apfelkern/Sources/apfelkern/BotSecretBoard.swift b/apfelkern/Sources/apfelkern/BotSecretBoard.swift index 1c0fcd1..ba91f1f 100644 --- a/apfelkern/Sources/apfelkern/BotSecretBoard.swift +++ b/apfelkern/Sources/apfelkern/BotSecretBoard.swift @@ -198,6 +198,11 @@ public final class BotSecretBoard { return .outcome(saved ? "Saved" : "Declined") } + /// The card shows the request waiting, saved, or declined rather than loading or unavailable. + public func isReady(_ ask: BotSecretAsk) -> Bool { + waiting(ask) != nil || answered.contains(ask) + } + private func waiting(_ ask: BotSecretAsk) -> BotSecretRequest? { requests(ask.kind, agentID: agentID).first(where: ask.matches) } diff --git a/apfelkern/Sources/apfelkern/CallRequestBoard.swift b/apfelkern/Sources/apfelkern/CallRequestBoard.swift index ddefe5d..b85d2da 100644 --- a/apfelkern/Sources/apfelkern/CallRequestBoard.swift +++ b/apfelkern/Sources/apfelkern/CallRequestBoard.swift @@ -54,6 +54,9 @@ public final class CallRequestBoard { requests.first { $0.id == request.id } ?? request } + /// The server listed the request, so its card shows the server's state rather than the saved one. + public func isLoaded(_ id: String) -> Bool { requests.contains { $0.id == id } } + public func decision(for id: String) -> CallRequestDecision { decisions[id] ?? CallRequestDecision() } diff --git a/apfelkern/Sources/apfelkern/ChatAttention.swift b/apfelkern/Sources/apfelkern/ChatAttention.swift new file mode 100644 index 0000000..c596063 --- /dev/null +++ b/apfelkern/Sources/apfelkern/ChatAttention.swift @@ -0,0 +1,326 @@ +import CoreGraphics +import Foundation + +/// Tells the server which chat this app's view shows, so a reply there sends no push to any of the owner's +/// devices, and which replies the owner has seen. Independent of push registration and notification permission. +/// +/// A view reports a chat only while the app is active, the route shows that chat, and the chat's view is mounted. +/// Reports for the view go out one at a time and always send the latest state, so a delayed refresh can't follow +/// a clear. A new connection gets a new view ID; the old view clears through the old connection. +@MainActor +public final class ChatAttention { + public struct Timing: Sendable { + public var heartbeat: Duration + /// How long displayed replies gather before they're sent together. + public var batchDelay: Duration + public var retry: Duration + public var maxRetry: Duration + /// How long a retired view gets to clear before its requests are cancelled. + public var clearTimeout: Duration + + public init( + heartbeat: Duration = .seconds(30), batchDelay: Duration = .milliseconds(100), + retry: Duration = .seconds(1), maxRetry: Duration = .seconds(30), clearTimeout: Duration = .seconds(2) + ) { + self.heartbeat = heartbeat + self.batchDelay = batchDelay + self.retry = retry + self.maxRetry = maxRetry + self.clearTimeout = clearTimeout + } + } + + /// The server's name for this view; a new connection gets a new one. + public private(set) var viewID = newRequestID() + private let timing: Timing + private var connection: Connection? + /// A connection signed out through `disconnect`, refused until a different one arrives. + private var disconnected: ConnectionKey? + private var active = false + private var route: ChatAttentionChat? + private var mounted: ChatAttentionChat? + private var surfaces = ReplySurfaces() + + public init(timing: Timing = Timing()) { + self.timing = timing + } + + /// The chat that has the owner's attention, if any. + public var shown: ChatAttentionChat? { + guard active, let route, route == mounted else { return nil } + return route + } + + /// The signed-in connection, whether the app or window is active, and the chat its route shows. + public func update(client: APIClient?, active: Bool, route: ChatAttentionChat?) { + let key = client.flatMap(ConnectionKey.init) + let next = key == disconnected ? nil : key + if connection?.key != next { + if next != nil { disconnected = nil } + replaceConnection(with: next.flatMap { key in client.map { ($0, key) } }) + } + self.active = active + self.route = route + refresh() + } + + // MARK: The chat's view + + /// The chat's view is on screen and showing its transcript. + public func mount(_ chat: ChatAttentionChat) { + if mounted != chat { surfaces.keep(only: chat) } + mounted = chat + refresh() + } + + /// A view that goes away clears only its own chat, since the next one can mount first. Its rows take their + /// surfaces with them. + public func unmount(_ chat: ChatAttentionChat) { + guard mounted == chat else { return } + mounted = nil + refresh() + } + + /// What the toolbar and composer cover at the top and bottom of the chat's scroll view. + public func setViewportInsets(top: CGFloat, bottom: CGFloat) { + surfaces.setInsets(top: top, bottom: bottom) + acknowledgeVisible() + } + + /// A reply surface's frame and its scroll view's size, both in the scroll view's coordinates, the events it + /// shows, and whether its content is ready. + public func setSurface( + _ key: String, of chat: ChatAttentionChat, frame: CGRect, container: CGSize, eventIDs: [String], ready: Bool + ) { + surfaces.set(key, of: chat, frame: frame, container: container, eventIDs: eventIDs, ready: ready) + acknowledgeVisible() + } + + public func removeSurface(_ key: String, of chat: ChatAttentionChat) { + surfaces.remove(key, of: chat) + } + + // MARK: Connections + + /// Clears this view through `client` before its session is revoked, waiting at most the clear timeout. Seen + /// replies not yet sent are dropped; a lost clear expires on the server. + public func disconnect(_ client: APIClient) async { + guard let old = connection, old.key == ConnectionKey(client) else { return } + disconnected = old.key + replaceConnection(with: nil) + active = false + route = nil + await old.reporter.finished() + } + + /// Waits, at most the clear timeout, for this view's latest report to reach the server, as when iOS suspends the + /// app after it leaves the foreground. + public func settle() async { + await connection?.reporter.idle(within: timing.clearTimeout) + } + + private func replaceConnection(with next: (client: APIClient, key: ConnectionKey)?) { + if let old = connection { + old.stop() + old.reporter.retire(within: timing.clearTimeout) + } + viewID = newRequestID() + surfaces.keep(only: nil) + connection = next.map { Connection(client: $0.client, key: $0.key, viewID: viewID, timing: timing) } + } + + private func refresh() { + connection?.reporter.set(shown) + acknowledgeVisible() + } + + private func acknowledgeVisible() { + guard let chat = shown, let connection else { return } + connection.displayed(surfaces.visibleEventIDs(in: chat), in: chat) + } +} + +/// One signed-in session: a server and its token. Signed out when the token is empty. +struct ConnectionKey: Hashable { + var baseURL: String + var token: String + + init?(_ client: APIClient) { + guard !client.token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { return nil } + baseURL = client.baseURL + token = client.token + } +} + +/// A connection's view reporter and its seen replies, which wait in per-chat batches and retry until they're +/// accepted, the server refuses them, or the connection ends. +@MainActor +private final class Connection { + let key: ConnectionKey + let client: APIClient + let reporter: ViewReporter + private let timing: ChatAttention.Timing + /// Every event queued so far, so a surface that stays on screen is acknowledged once. + private var known: [ChatAttentionChat: Set] = [:] + private var pending: [(chat: ChatAttentionChat, eventIDs: [String])] = [] + private var worker: Task? + private var stopped = false + private var unauthorized = false + + init(client: APIClient, key: ConnectionKey, viewID: String, timing: ChatAttention.Timing) { + self.client = client + self.key = key + self.timing = timing + reporter = ViewReporter(client: client, viewID: viewID, timing: timing) + } + + func stop() { + stopped = true + worker?.cancel() + worker = nil + pending = [] + known = [:] + } + + func displayed(_ eventIDs: [String], in chat: ChatAttentionChat) { + guard !stopped, !unauthorized else { return } + var known = self.known[chat, default: []] + let earned = eventIDs.filter { !$0.isEmpty && known.insert($0).inserted } + self.known[chat] = known + guard !earned.isEmpty else { return } + if let index = pending.firstIndex(where: { $0.chat == chat }) { + pending[index].eventIDs += earned + } else { + pending.append((chat, earned)) + } + guard worker == nil else { return } + worker = Task { [weak self] in await self?.flush() } + } + + /// A batch keeps the chat it was earned in, wherever the owner has gone since. + private func flush() async { + try? await Task.sleep(for: timing.batchDelay) + while !stopped, !unauthorized, !Task.isCancelled, let next = pending.first { + let batch = Array(next.eventIDs.prefix(100)) + pending[0].eventIDs.removeFirst(batch.count) + if pending[0].eventIDs.isEmpty { pending.removeFirst() } + await submit(batch, in: next.chat) + } + if !Task.isCancelled { worker = nil } + } + + /// The server accepts a batch whole or not at all, so a refused batch is sent again one event at a time and only + /// the refused events are dropped. + private func submit(_ eventIDs: [String], in chat: ChatAttentionChat) async { + var delay = timing.retry + while !stopped, !unauthorized, !Task.isCancelled { + do { + try await client.markRepliesSeen(eventIDs, in: chat) + return + } catch let error as APIError where error.statusCode == 401 { + unauthorized = true + } catch let error as APIError where [400, 404].contains(error.statusCode) { + guard eventIDs.count > 1 else { return } + for id in eventIDs { await submit([id], in: chat) } + return + } catch { + try? await Task.sleep(for: delay) + delay = min(delay * 2, timing.maxRetry) + } + } + } +} + +/// Sends one view's reports in order. Each request carries the newest state, so changes that pile up behind a +/// request in flight collapse into one, and a refresh can't follow a clear. +@MainActor +private final class ViewReporter { + private let client: APIClient + private let viewID: String + private let timing: ChatAttention.Timing + private var desired: ChatAttentionChat? + private var revision = 0 + private var sent = 0 + private var worker: Task? + private var backoff: Task? + private var heartbeat: Task? + private var retired = false + private var stopped = false + + init(client: APIClient, viewID: String, timing: ChatAttention.Timing) { + self.client = client + self.viewID = viewID + self.timing = timing + heartbeat = Task { [weak self] in + while !Task.isCancelled { + try? await Task.sleep(for: timing.heartbeat) + guard let self, !Task.isCancelled else { return } + if !retired, let desired { set(desired, force: true) } + } + } + } + + func set(_ chat: ChatAttentionChat?, force: Bool = false) { + guard !stopped, force || chat != desired else { return } + desired = chat + revision += 1 + backoff?.cancel() + // Holds the reporter until it's done, so a retired view still sends its clear. + if worker == nil { worker = Task { await self.run() } } + } + + /// Clears what this view reported, if anything, then cancels whatever is left after `timeout`. + func retire(within timeout: Duration) { + retired = true + heartbeat?.cancel() + set(nil) + guard worker != nil else { return } + Task { [weak self] in + try? await Task.sleep(for: timeout) + self?.cancel() + } + } + + func finished() async { + await worker?.value + } + + func idle(within timeout: Duration) async { + let deadline = ContinuousClock.now + timeout + while worker != nil, ContinuousClock.now < deadline { + try? await Task.sleep(for: .milliseconds(20)) + } + } + + private func cancel() { + stopped = true + heartbeat?.cancel() + backoff?.cancel() + worker?.cancel() + } + + private func run() async { + var delay = timing.retry + while !stopped, !Task.isCancelled, sent != revision { + let version = revision + do { + try await client.reportChatAttention(view: viewID, chat: desired) + sent = version + delay = timing.retry + } catch let error as APIError where error.statusCode == 401 { + stopped = true + } catch let error as APIError where [400, 404].contains(error.statusCode) { + // The chat is gone or the server refuses it; only a new state is worth sending. + sent = version + } catch { + guard !Task.isCancelled, version == revision else { continue } + let wait = Task { [delay] in _ = try? await Task.sleep(for: delay) } + backoff = wait + await wait.value + backoff = nil + delay = min(delay * 2, timing.maxRetry) + } + } + worker = nil + } +} diff --git a/apfelkern/Sources/apfelkern/ChatCards.swift b/apfelkern/Sources/apfelkern/ChatCards.swift index f0d4f54..503f54d 100644 --- a/apfelkern/Sources/apfelkern/ChatCards.swift +++ b/apfelkern/Sources/apfelkern/ChatCards.swift @@ -114,10 +114,8 @@ public func shownInChat(_ message: Message) -> Bool { } private func hasAssistantText(_ message: Message) -> Bool { - guard case .array(let blocks)? = message.blocks else { return !contentText(message.blocks).isEmpty } - return blocks.contains { - $0["type"]?.stringValue == "text" - && !($0["text"]?.stringValue ?? "").trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + (message.blocks ?? []).contains { + if case .text(let block) = $0 { !block.text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty } else { false } } } diff --git a/apfelkern/Sources/apfelkern/ChatModels.swift b/apfelkern/Sources/apfelkern/ChatModels.swift index 4cf0938..8edd3b8 100644 --- a/apfelkern/Sources/apfelkern/ChatModels.swift +++ b/apfelkern/Sources/apfelkern/ChatModels.swift @@ -83,7 +83,7 @@ public struct Message: Codable, Identifiable, Hashable, Sendable { public var entryId: String? public var role: String public var content: JSONValue? - public var blocks: JSONValue? + public var blocks: [TranscriptBlock]? public var kind: String? public var replyTo: String? public var replyPreview: String? @@ -102,20 +102,22 @@ public struct Message: Codable, Identifiable, Hashable, Sendable { public var toolDetails: JSONValue? /// The idempotency key echoed by the server for owner messages. public var requestId: String? - /// In a group chat, the pages the sending bot searched or read in the turn that wrote the message. - public var sources: [MessageSource]? + /// A bot reply as the server presents it: its text without citation links, and the pages it cited. + public var presentation: MessagePresentation? + /// Notification replies this message shows, each naming the exact surface whose display acknowledges it. + public var replyReferences: [ReplyReference] public var deliveryState: MessageDeliveryState public init( id: String, entryId: String? = nil, role: String, content: JSONValue? = nil, - blocks: JSONValue? = nil, kind: String? = nil, + blocks: [TranscriptBlock]? = nil, kind: String? = nil, replyTo: String? = nil, replyPreview: String? = nil, origin: MessageOrigin? = nil, communication: BotCommunication? = nil, jobQuestion: JobQuestionEvent? = nil, heldAction: HeldActionEvent? = nil, call: CallEvent? = nil, timestamp: Int64? = nil, attachments: [AttachmentInfo]? = nil, toolName: String? = nil, toolCallId: String? = nil, isError: Bool? = nil, - toolDetails: JSONValue? = nil, requestId: String? = nil, sources: [MessageSource]? = nil, - deliveryState: MessageDeliveryState = .confirmed + toolDetails: JSONValue? = nil, requestId: String? = nil, presentation: MessagePresentation? = nil, + replyReferences: [ReplyReference] = [], deliveryState: MessageDeliveryState = .confirmed ) { self.id = id self.entryId = entryId @@ -137,7 +139,8 @@ public struct Message: Codable, Identifiable, Hashable, Sendable { self.isError = isError self.toolDetails = toolDetails self.requestId = requestId - self.sources = sources + self.presentation = presentation + self.replyReferences = replyReferences self.deliveryState = deliveryState } @@ -147,7 +150,7 @@ public struct Message: Codable, Identifiable, Hashable, Sendable { entryId = try container.decodeIfPresent(String.self, forKey: .entryId) role = try container.decodeIfPresent(String.self, forKey: .role) ?? "" content = try container.decodeIfPresent(JSONValue.self, forKey: .content) - blocks = try container.decodeIfPresent(JSONValue.self, forKey: .blocks) + blocks = try container.decodeIfPresent([TranscriptBlock].self, forKey: .blocks) kind = try container.decodeIfPresent(String.self, forKey: .kind) replyTo = try container.decodeIfPresent(String.self, forKey: .replyTo) replyPreview = try container.decodeIfPresent(String.self, forKey: .replyPreview) @@ -164,55 +167,73 @@ public struct Message: Codable, Identifiable, Hashable, Sendable { isError = try container.decodeIfPresent(Bool.self, forKey: .isError) toolDetails = try container.decodeIfPresent(JSONValue.self, forKey: .toolDetails) requestId = try container.decodeIfPresent(String.self, forKey: .requestId) - sources = try container.decodeIfPresent([MessageSource].self, forKey: .sources) + presentation = try container.decodeIfPresent(MessagePresentation.self, forKey: .presentation) + replyReferences = try container.decodeIfPresent([ReplyReference].self, forKey: .replyReferences) ?? [] deliveryState = try container.decodeIfPresent(MessageDeliveryState.self, forKey: .deliveryState) ?? .confirmed } public var text: String { contentText(content) } + + /// What a reply shows: the server's text with its citations taken out, or the raw text. + public var presentedText: String { presentation?.text ?? text } + + /// The pages a reply cited, each once, shown after it instead of as links inside it. + public var citations: [Citation] { presentation?.citations ?? [] } } -/// A file a sent message carries, as the transcript lists it; image bytes are fetched separately. +/// A transcript content block, the same generated type over HTTP and the event stream. +public typealias TranscriptBlock = Components.Schemas.TranscriptBlock +public typealias MessagePresentation = Components.Schemas.MessagePresentation +public typealias Citation = Components.Schemas.Citation + +/// A file a message carries, as the transcript lists it; its bytes are fetched by `id` separately. public struct AttachmentInfo: Codable, Hashable, Sendable { + /// The server's file ID; empty on an optimistic row the server has not confirmed yet. + public var id: String public var name: String public var mimeType: String public var size: Int - public var kind: String + /// The file was deleted from its chat's library; only its ID remains. + public var deleted: Bool - public var isImage: Bool { kind == "image" } + /// Previews follow the MIME type; a deleted file has none. + public var isImage: Bool { !deleted && mimeType.hasPrefix("image/") } - public init( - name: String, - mimeType: String, - size: Int, - kind: String - ) { + public init(id: String = "", name: String, mimeType: String, size: Int, deleted: Bool = false) { + self.id = id self.name = name self.mimeType = mimeType self.size = size - self.kind = kind + self.deleted = deleted } -} -/// A file on its way to the server, in the shape the messages endpoint takes. -public typealias OutgoingAttachment = Operations.SendMessage.Input.Body.JsonPayload.AttachmentsPayloadPayload + public static func deleted(_ id: String) -> AttachmentInfo { + AttachmentInfo(id: id, name: "", mimeType: "", size: 0, deleted: true) + } -extension OutgoingAttachment { - public init(name: String, mimeType: String, data: String) { - self.init(data: data, mimeType: mimeType, name: name) + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + id = try container.decodeIfPresent(String.self, forKey: .id) ?? "" + name = try container.decodeIfPresent(String.self, forKey: .name) ?? "" + mimeType = try container.decodeIfPresent(String.self, forKey: .mimeType) ?? "" + size = try container.decodeIfPresent(Int.self, forKey: .size) ?? 0 + deleted = try container.decodeIfPresent(Bool.self, forKey: .deleted) ?? false } } public struct ChatSnapshot: Codable, Sendable { public var messages: [Message]? public var status: String? + /// What the bot is doing during its turn, as the server reads it from the transcript. + public var working: Working public var partial: String? public var error: String? public var agentId: String? public var hasMore: Bool? public var oldestEntryId: String? - public var isRunning: Bool { status == "running" } + public var isRunning: Bool { working != .idle && working != .failed } public init(from decoder: Decoder) throws { let event = try Components.Schemas.EventChatSnapshot(from: decoder) @@ -224,6 +245,7 @@ public struct ChatSnapshot: Codable, Sendable { public init( messages: [Message]? = nil, status: String? = nil, + working: Working = .idle, partial: String? = nil, error: String? = nil, agentId: String? = nil, @@ -232,6 +254,7 @@ public struct ChatSnapshot: Codable, Sendable { ) { self.messages = messages self.status = status + self.working = working self.partial = partial self.error = error self.agentId = agentId diff --git a/apfelkern/Sources/apfelkern/CodingJob.swift b/apfelkern/Sources/apfelkern/CodingJob.swift index 56c14dd..409ce52 100644 --- a/apfelkern/Sources/apfelkern/CodingJob.swift +++ b/apfelkern/Sources/apfelkern/CodingJob.swift @@ -94,94 +94,38 @@ public struct JobQuestionEvent: Codable, Hashable, Sendable { } } -/// One readable step of a coding job's history. -public enum CodingJobItem: Identifiable, Hashable, Sendable { - case task(id: String, text: String) - case reply(id: String, text: String) - case tool(Tool) - - public struct Tool: Hashable, Sendable { - public var id: String - public var name: String - /// The command a `bash` call ran, or the path a file call touched. - public var subject: String - public var output: String - public var isError: Bool - public var finished: Bool - - /// The whole output as an expanded step shows it. - public var shownOutput: String { - output.trimmingCharacters(in: .newlines).nilIfEmpty ?? "No output." - } - } +/// One readable item of a job's history: its task, a reply, or a tool step with its result once it has one. +/// The server reads them from the transcript, attaching a result even when it landed on a newer page. +public typealias JobHistoryItem = Components.Schemas.JobHistoryItem +public typealias JobStepItem = Components.Schemas.JobStepItem +extension Components.Schemas.JobHistoryItem: Identifiable { public var id: String { switch self { - case .task(let id, _), .reply(let id, _): id - case .tool(let tool): tool.id + case .task(let task): task.id + case .reply(let reply): reply.id + case .step(let step): step.id } } - /// Turns job history, oldest first, into items: tool results fold into the call they answer. - public static func items(from messages: [Message]) -> [CodingJobItem] { - var items: [CodingJobItem] = [] - var open: [String: Int] = [:] - for message in messages { - switch message.role { - case "user": - if !message.text.isEmpty { items.append(.task(id: message.id, text: message.text)) } - case "assistant": - appendAssistantItems(of: message, to: &items, open: &open) - case "toolResult": - appendResult(of: message, to: &items, open: open) - default: - break - } - } - return items + /// A step still waiting on its tool's result. + var isUnfinishedStep: Bool { + if case .step(let step) = self { step.result == nil } else { false } } +} - private static func appendAssistantItems( - of message: Message, to items: inout [CodingJobItem], open: inout [String: Int] - ) { - guard case .array(let blocks)? = message.blocks else { - if !message.text.isEmpty { items.append(.reply(id: message.id, text: message.text)) } - return - } - for (index, block) in blocks.enumerated() { - let id = "\(message.id):\(index)" - switch block["type"]?.stringValue { - case "text": - let text = (block["text"]?.stringValue ?? "").trimmingCharacters(in: .whitespacesAndNewlines) - if !text.isEmpty { items.append(.reply(id: id, text: text)) } - case "toolCall": - let arguments = block["arguments"] - let subject = arguments?["command"]?.stringValue ?? arguments?["path"]?.stringValue ?? "" - if let callID = block["id"]?.stringValue, !callID.isEmpty { open[callID] = items.count } - items.append( - .tool( - Tool( - id: id, name: block["name"]?.stringValue ?? "", subject: subject, output: "", - isError: false, finished: false))) - default: - break - } - } - } +extension Components.Schemas.JobStepItem { + public var finished: Bool { result != nil } + public var isError: Bool { result?.isError == true } - private static func appendResult(of message: Message, to items: inout [CodingJobItem], open: [String: Int]) { - let failed = message.isError == true - if let callID = message.toolCallId, let index = open[callID], case .tool(var tool) = items[index] { - tool.output = message.text - tool.isError = failed - tool.finished = true - items[index] = .tool(tool) - } else { - items.append( - .tool( - Tool( - id: message.id, name: message.toolName ?? "", subject: "", output: message.text, isError: failed, - finished: true))) - } + /// The whole output as an expanded step shows it. + public var shownOutput: String { + (result?.content ?? "").trimmingCharacters(in: .newlines).nilIfEmpty ?? "No output." } } + +/// Keeps items loaded earlier and those the newest page has scrolled past; the newest page replaces the rest. +public func mergeJobItems(_ existing: [JobHistoryItem], _ newest: [JobHistoryItem]) -> [JobHistoryItem] { + guard let first = newest.first?.id else { return existing } + return existing.prefix { $0.id != first } + newest +} diff --git a/apfelkern/Sources/apfelkern/ContractAdapters.swift b/apfelkern/Sources/apfelkern/ContractAdapters.swift index 45749f4..1bf7529 100644 --- a/apfelkern/Sources/apfelkern/ContractAdapters.swift +++ b/apfelkern/Sources/apfelkern/ContractAdapters.swift @@ -35,7 +35,7 @@ extension Message { init(wire: Components.Schemas.TranscriptMessage) throws { self.init( id: wire.id, entryId: wire.entryId, role: wire.role, content: .string(wire.content), - blocks: try wire.blocks.map { try JSONValue(wire: $0) }, kind: wire.kind, + blocks: wire.blocks, kind: wire.kind, replyTo: wire.replyTo, replyPreview: wire.replyPreview, origin: wire.origin.map { MessageOrigin(kind: $0.kind, name: $0.name, agentId: $0.agentId, via: $0.via, source: $0.source) @@ -50,12 +50,22 @@ extension Message { CallEvent(callId: $0.callId, direction: CallEvent.Direction(wire: $0.direction), callee: $0.callee) }, timestamp: wire.timestamp.flatMap(Int64.init(exactly:)), - attachments: wire.attachments?.map { - AttachmentInfo(name: $0.name, mimeType: $0.mimeType, size: Int(exactly: $0.size) ?? 0, - kind: $0.kind.rawValue) - }, toolName: wire.toolName, toolCallId: wire.toolCallId, isError: wire.isError, + attachments: wire.files?.compactMap(AttachmentInfo.init(wire:)), toolName: wire.toolName, + toolCallId: wire.toolCallId, isError: wire.isError, toolDetails: try wire.toolDetails.map { try JSONValue(wire: $0) }, requestId: wire.requestId, - sources: wire.sources?.map { MessageSource(url: $0.url, title: $0.title) }) + presentation: wire.presentation, replyReferences: wire.replyReferences.map(ReplyReference.init(wire:))) + } +} + +extension AttachmentInfo { + init?(wire: Components.Schemas.TranscriptMessage.FilesPayloadPayload) { + if let file = wire.value1 { + self.init(id: file.id, name: file.name, mimeType: file.mimeType, size: Int(exactly: file.size.rounded()) ?? 0) + } else if let file = wire.value2, file.deleted { + self = .deleted(file.id) + } else { + return nil + } } } @@ -72,7 +82,8 @@ extension ChatSnapshot { init(wire: Components.Schemas.ChatSnapshot) throws { self.init( messages: try wire.value1.messages.map(Message.init(wire:)), status: wire.value2.status.rawValue, - partial: wire.value2.partial, error: wire.value2.error, agentId: wire.value2.agentId, + working: Working(rawValue: wire.value2.working.rawValue) ?? .idle, partial: wire.value2.partial, + error: wire.value2.error, agentId: wire.value2.agentId, hasMore: wire.value1.hasMore, oldestEntryId: wire.value1.oldestEntryId) } } @@ -84,6 +95,14 @@ extension ChatHistoryResponse { } } +extension JobHistoryPage { + init(wire: Components.Schemas.JobHistoryPage) throws { + self.init( + messages: try wire.value1.messages.map(Message.init(wire:)), items: wire.value2.items, + hasMore: wire.value1.hasMore, oldestEntryId: wire.value1.oldestEntryId) + } +} + extension Memory { init(wire: Components.Schemas.Memory) { self.init( @@ -120,7 +139,8 @@ extension Schedule { prompt: wire.prompt, kind: ScheduleKind(wire: wire.kind), command: wire.command, timeoutSeconds: wire.timeoutSeconds, notify: wire.notify, timezone: wire.timezone, runAt: wire.runAt, eventSourceId: wire.eventSourceId, enabled: wire.enabled, - nextRunAt: wire.nextRunAt, createdByAgentId: wire.createdByAgentId) + nextRunAt: wire.nextRunAt, createdByAgentId: wire.createdByAgentId, + description: wire.description, timing: wire.timing, nextRunLabel: wire.nextRunLabel) } } diff --git a/apfelkern/Sources/apfelkern/ContractTransport.swift b/apfelkern/Sources/apfelkern/ContractTransport.swift index d2ecc21..3add6a1 100644 --- a/apfelkern/Sources/apfelkern/ContractTransport.swift +++ b/apfelkern/Sources/apfelkern/ContractTransport.swift @@ -7,6 +7,8 @@ struct ContractTransport: ClientTransport { let token: String let timeout: TimeInterval let nullFields: Set + /// Header fields that replace what the generated operation set, such as an upload's real `Content-Type`. + var headers: [String: String] = [:] /// Server-sent event operations, whose responses never finish; every other response is read whole. static let streamingOperations: Set = [ @@ -49,6 +51,7 @@ struct ContractTransport: ClientTransport { var result = URLRequest(url: url, timeoutInterval: timeout) result.httpMethod = request.method.rawValue for field in request.headerFields { result.addValue(field.value, forHTTPHeaderField: field.name.rawName) } + for (name, value) in headers { result.setValue(value, forHTTPHeaderField: name) } if !token.isEmpty { result.setValue("Bearer " + token, forHTTPHeaderField: "Authorization") } if let body { result.httpBody = try await Data(collecting: body, upTo: .max) } try restoreNullFields(in: &result, operationID: operationID) @@ -62,7 +65,6 @@ struct ContractTransport: ClientTransport { switch operationID { case Operations.UpdateSchedule.id, Operations.CreateSchedule.id: allowed = ["cron", "runAt", "eventSourceId", "command"] - case Operations.PutPushPresence.id: allowed = ["agentId"] case Operations.CreateMcpServer.id: allowed = ["agentId"] case Operations.UpdateMcpServer.id: allowed = ["oauthClientId", "oauthClientSecret"] case Operations.UpdateAgent.id: allowed = ["desktopModel", "webSearchProvider"] @@ -72,6 +74,7 @@ struct ContractTransport: ClientTransport { case Operations.UpdateEventRelay.id: allowed = ["url"] case Operations.UpdateJudgeModel.id: allowed = ["judgeModel"] case Operations.UpdateVisionModel.id: allowed = ["visionModel"] + case Operations.PutChatAttentionView.id: allowed = ["chat"] default: allowed = [] } guard nullFields.isSubset(of: allowed), let body = request.httpBody, @@ -120,11 +123,13 @@ func decodeUTF8(_ data: Data) -> String { extension APIClient { func invoke( - timeout: TimeInterval = 20, nullFields: Set = [], _ operation: @Sendable (Client) async throws -> T + timeout: TimeInterval = 20, nullFields: Set = [], headers: [String: String] = [:], + _ operation: @Sendable (Client) async throws -> T ) async throws -> T { guard let url = URL(string: baseURL) else { throw URLError(.badURL) } let client = Client(serverURL: url, configuration: .init(dateTranscoder: .iso8601WithFractionalSeconds), - transport: ContractTransport(session: session, token: token, timeout: timeout, nullFields: nullFields)) + transport: ContractTransport( + session: session, token: token, timeout: timeout, nullFields: nullFields, headers: headers)) do { return try await operation(client) } catch let error as ClientError { diff --git a/apfelkern/Sources/apfelkern/DeletedFiles.swift b/apfelkern/Sources/apfelkern/DeletedFiles.swift new file mode 100644 index 0000000..a3aeabe --- /dev/null +++ b/apfelkern/Sources/apfelkern/DeletedFiles.swift @@ -0,0 +1,38 @@ +import Foundation + +/// The files the server reported deleted in the chats one connection has open. A transcript can list a file in several +/// messages while only the newest page says it is gone, so every reference in the chat follows the deletion. +public struct DeletedFiles: Sendable { + private var keys: Set = [] + + public init() {} + + /// Remembers the files `messages` report deleted and returns them with every other reference to those files + /// deleted too. + public mutating func reconcile(_ messages: [Message], chat: String) -> [Message] { + for message in messages { + for file in message.attachments ?? [] where file.deleted && !file.id.isEmpty { + keys.insert(Self.key(file.id, chat: chat)) + } + } + guard !keys.isEmpty else { return messages } + return messages.map { message in + guard let files = message.attachments, + files.contains(where: { !$0.deleted && contains($0.id, chat: chat) }) + else { return message } + var message = message + message.attachments = files.map { !$0.deleted && contains($0.id, chat: chat) ? .deleted($0.id) : $0 } + return message + } + } + + public func contains(_ fileID: String, chat: String) -> Bool { + !fileID.isEmpty && keys.contains(Self.key(fileID, chat: chat)) + } + + public mutating func removeAll() { + keys.removeAll() + } + + private static func key(_ fileID: String, chat: String) -> String { chat + "/" + fileID } +} diff --git a/apfelkern/Sources/apfelkern/DesktopJob.swift b/apfelkern/Sources/apfelkern/DesktopJob.swift index 9623482..3b553a1 100644 --- a/apfelkern/Sources/apfelkern/DesktopJob.swift +++ b/apfelkern/Sources/apfelkern/DesktopJob.swift @@ -84,9 +84,9 @@ extension APIClient { } public func desktopJobHistory(_ agentID: String, name: String, before: String, limit: Int) - async throws -> ChatHistoryResponse { + async throws -> JobHistoryPage { try await invoke { - try ChatHistoryResponse(wire: await $0.getDesktopJobHistory(.init( + try JobHistoryPage(wire: await $0.getDesktopJobHistory(.init( path: .init(id: agentID, name: name), query: .init(limit: limit > 0 ? limit : nil, before: before.nilIfEmpty) )).ok.body.json) diff --git a/apfelkern/Sources/apfelkern/Generated/Client.swift b/apfelkern/Sources/apfelkern/Generated/Client.swift index b51ed05..5c994b1 100644 --- a/apfelkern/Sources/apfelkern/Generated/Client.swift +++ b/apfelkern/Sources/apfelkern/Generated/Client.swift @@ -6864,7 +6864,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TranscriptPage.self, + Components.Schemas.JobHistoryPage.self, from: responseBody, transforming: { value in .json(value) @@ -8764,7 +8764,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.TranscriptPage.self, + Components.Schemas.JobHistoryPage.self, from: responseBody, transforming: { value in .json(value) @@ -10652,17 +10652,15 @@ public struct Client: APIProtocol { } ) } - /// Desktop job actions an intent check held for the owner, newest first, pending and decided. - /// - /// - Remark: HTTP `GET /v1/agents/{id}/held-actions`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)`. - public func listAgentHeldActions(_ input: Operations.ListAgentHeldActions.Input) async throws -> Operations.ListAgentHeldActions.Output { + /// - Remark: HTTP `GET /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)`. + public func listFiles(_ input: Operations.ListFiles.Input) async throws -> Operations.ListFiles.Output { try await client.send( input: input, - forOperation: Operations.ListAgentHeldActions.id, + forOperation: Operations.ListFiles.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/held-actions", + template: "/v1/agents/{}/files", parameters: [ input.path.id ] @@ -10672,6 +10670,20 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -10682,7 +10694,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.Ok.Body + let body: Operations.ListFiles.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10692,7 +10704,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.HeldAction].self, + [Components.Schemas.LibraryFile].self, from: responseBody, transforming: { value in .json(value) @@ -10704,7 +10716,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.BadRequest.Body + let body: Operations.ListFiles.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10726,7 +10738,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.Unauthorized.Body + let body: Operations.ListFiles.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10748,7 +10760,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.NotFound.Body + let body: Operations.ListFiles.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10770,7 +10782,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.MethodNotAllowed.Body + let body: Operations.ListFiles.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10792,7 +10804,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.Conflict.Body + let body: Operations.ListFiles.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10814,7 +10826,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.ContentTooLarge.Body + let body: Operations.ListFiles.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10836,7 +10848,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.InternalServerError.Body + let body: Operations.ListFiles.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10858,7 +10870,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentHeldActions.Output.ServiceUnavailable.Body + let body: Operations.ListFiles.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10890,20 +10902,17 @@ public struct Client: APIProtocol { } ) } - /// Runs the held action; the job continues where it stopped. Fails with 409 once the action was decided. - /// - /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/approve`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)`. - public func approveAgentHeldAction(_ input: Operations.ApproveAgentHeldAction.Input) async throws -> Operations.ApproveAgentHeldAction.Output { + /// - Remark: HTTP `POST /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)`. + public func uploadFile(_ input: Operations.UploadFile.Input) async throws -> Operations.UploadFile.Output { try await client.send( input: input, - forOperation: Operations.ApproveAgentHeldAction.id, + forOperation: Operations.UploadFile.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/held-actions/{}/approve", + template: "/v1/agents/{}/files", parameters: [ - input.path.id, - input.path.actionId + input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -10911,17 +10920,31 @@ public struct Client: APIProtocol { method: .post ) suppressMutabilityWarning(&request) + try converter.setHeaderFieldAsURI( + in: &request.headerFields, + name: "x-file-name", + value: input.headers.xFileName + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .any(value): + body = try converter.setRequiredRequestBodyAsBinary( + value, + headerFields: &request.headerFields, + contentType: "*/*" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.Ok.Body + let body: Operations.UploadFile.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10931,7 +10954,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.HeldAction.self, + Components.Schemas.UploadFile.self, from: responseBody, transforming: { value in .json(value) @@ -10940,10 +10963,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.BadRequest.Body + let body: Operations.UploadFile.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10965,7 +10988,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.Unauthorized.Body + let body: Operations.UploadFile.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -10987,7 +11010,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.NotFound.Body + let body: Operations.UploadFile.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11009,7 +11032,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed.Body + let body: Operations.UploadFile.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11031,7 +11054,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.Conflict.Body + let body: Operations.UploadFile.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11053,7 +11076,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.ContentTooLarge.Body + let body: Operations.UploadFile.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11075,7 +11098,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.InternalServerError.Body + let body: Operations.UploadFile.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11097,7 +11120,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable.Body + let body: Operations.UploadFile.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11129,60 +11152,49 @@ public struct Client: APIProtocol { } ) } - /// Refuses the held action with an optional reason; the job reports back. Fails with 409 once the action was decided. - /// - /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/decline`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)`. - public func declineAgentHeldAction(_ input: Operations.DeclineAgentHeldAction.Input) async throws -> Operations.DeclineAgentHeldAction.Output { + /// - Remark: HTTP `GET /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)`. + public func getFile(_ input: Operations.GetFile.Input) async throws -> Operations.GetFile.Output { try await client.send( input: input, - forOperation: Operations.DeclineAgentHeldAction.id, + forOperation: Operations.GetFile.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/held-actions/{}/decline", + template: "/v1/agents/{}/files/{}", parameters: [ input.path.id, - input.path.actionId + input.path.fileId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.Ok.Body + let body: Operations.GetFile.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/octet-stream" ] ) switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.HeldAction.self, + case "application/octet-stream": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, from: responseBody, transforming: { value in - .json(value) + .binary(value) } ) default: @@ -11191,7 +11203,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.BadRequest.Body + let body: Operations.GetFile.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11213,7 +11225,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.Unauthorized.Body + let body: Operations.GetFile.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11235,7 +11247,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.NotFound.Body + let body: Operations.GetFile.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11257,7 +11269,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed.Body + let body: Operations.GetFile.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11279,7 +11291,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.Conflict.Body + let body: Operations.GetFile.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11301,7 +11313,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.ContentTooLarge.Body + let body: Operations.GetFile.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11323,7 +11335,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.InternalServerError.Body + let body: Operations.GetFile.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11345,7 +11357,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable.Body + let body: Operations.GetFile.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11377,24 +11389,23 @@ public struct Client: APIProtocol { } ) } - /// The logins the bot's desktop jobs can fill into web pages, and its requests for logins the owner has not answered. Values are never returned. - /// - /// - Remark: HTTP `GET /v1/agents/{id}/logins`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)`. - public func listAgentLogins(_ input: Operations.ListAgentLogins.Input) async throws -> Operations.ListAgentLogins.Output { + /// - Remark: HTTP `DELETE /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)`. + public func deleteFile(_ input: Operations.DeleteFile.Input) async throws -> Operations.DeleteFile.Output { try await client.send( input: input, - forOperation: Operations.ListAgentLogins.id, + forOperation: Operations.DeleteFile.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/logins", + template: "/v1/agents/{}/files/{}", parameters: [ - input.path.id + input.path.id, + input.path.fileId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -11405,31 +11416,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Logins.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.BadRequest.Body + let body: Operations.DeleteFile.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11451,7 +11442,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.Unauthorized.Body + let body: Operations.DeleteFile.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11473,7 +11464,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.NotFound.Body + let body: Operations.DeleteFile.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11495,7 +11486,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.MethodNotAllowed.Body + let body: Operations.DeleteFile.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11517,7 +11508,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.Conflict.Body + let body: Operations.DeleteFile.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11539,7 +11530,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.ContentTooLarge.Body + let body: Operations.DeleteFile.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11561,7 +11552,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.InternalServerError.Body + let body: Operations.DeleteFile.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11583,7 +11574,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLogins.Output.ServiceUnavailable.Body + let body: Operations.DeleteFile.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11615,47 +11606,37 @@ public struct Client: APIProtocol { } ) } - /// Creates or updates a login. Saving one the bot requested answers the request and starts a bot turn with a notice. Each field is a value stored in Crumble or a password manager reference; a 1Password `item` fills every field. Every reference is read once to check it, and nothing is saved if one fails. + /// Desktop job actions an intent check held for the owner, newest first, pending and decided. /// - /// - Remark: HTTP `PUT /v1/agents/{id}/logins/{name}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)`. - public func saveAgentLogin(_ input: Operations.SaveAgentLogin.Input) async throws -> Operations.SaveAgentLogin.Output { + /// - Remark: HTTP `GET /v1/agents/{id}/held-actions`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)`. + public func listAgentHeldActions(_ input: Operations.ListAgentHeldActions.Input) async throws -> Operations.ListAgentHeldActions.Output { try await client.send( input: input, - forOperation: Operations.SaveAgentLogin.id, + forOperation: Operations.ListAgentHeldActions.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/logins/{}", + template: "/v1/agents/{}/held-actions", parameters: [ - input.path.id, - input.path.name + input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.Ok.Body + let body: Operations.ListAgentHeldActions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11665,7 +11646,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Login.self, + [Components.Schemas.HeldAction].self, from: responseBody, transforming: { value in .json(value) @@ -11677,7 +11658,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.BadRequest.Body + let body: Operations.ListAgentHeldActions.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11699,7 +11680,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.Unauthorized.Body + let body: Operations.ListAgentHeldActions.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11721,7 +11702,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.NotFound.Body + let body: Operations.ListAgentHeldActions.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11743,7 +11724,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.MethodNotAllowed.Body + let body: Operations.ListAgentHeldActions.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11765,7 +11746,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.Conflict.Body + let body: Operations.ListAgentHeldActions.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11787,7 +11768,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.ContentTooLarge.Body + let body: Operations.ListAgentHeldActions.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11809,7 +11790,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.InternalServerError.Body + let body: Operations.ListAgentHeldActions.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11831,7 +11812,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SaveAgentLogin.Output.ServiceUnavailable.Body + let body: Operations.ListAgentHeldActions.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11863,25 +11844,25 @@ public struct Client: APIProtocol { } ) } - /// Deletes a login and its fill records, or declines a request for one, which starts a bot turn with a notice. + /// Runs the held action; the job continues where it stopped. Fails with 409 once the action was decided. /// - /// - Remark: HTTP `DELETE /v1/agents/{id}/logins/{name}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)`. - public func deleteAgentLogin(_ input: Operations.DeleteAgentLogin.Input) async throws -> Operations.DeleteAgentLogin.Output { + /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/approve`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)`. + public func approveAgentHeldAction(_ input: Operations.ApproveAgentHeldAction.Input) async throws -> Operations.ApproveAgentHeldAction.Output { try await client.send( input: input, - forOperation: Operations.DeleteAgentLogin.id, + forOperation: Operations.ApproveAgentHeldAction.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/logins/{}", + template: "/v1/agents/{}/held-actions/{}/approve", parameters: [ input.path.id, - input.path.name + input.path.actionId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -11892,11 +11873,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ApproveAgentHeldAction.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.HeldAction.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.BadRequest.Body + let body: Operations.ApproveAgentHeldAction.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11918,7 +11919,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.Unauthorized.Body + let body: Operations.ApproveAgentHeldAction.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11940,7 +11941,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.NotFound.Body + let body: Operations.ApproveAgentHeldAction.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11962,7 +11963,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.MethodNotAllowed.Body + let body: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -11984,7 +11985,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.Conflict.Body + let body: Operations.ApproveAgentHeldAction.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12006,7 +12007,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.ContentTooLarge.Body + let body: Operations.ApproveAgentHeldAction.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12028,7 +12029,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.InternalServerError.Body + let body: Operations.ApproveAgentHeldAction.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12050,7 +12051,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentLogin.Output.ServiceUnavailable.Body + let body: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12082,20 +12083,20 @@ public struct Client: APIProtocol { } ) } - /// Declines a pending login request without changing a saved login. + /// Refuses the held action with an optional reason; the job reports back. Fails with 409 once the action was decided. /// - /// - Remark: HTTP `POST /v1/agents/{id}/logins/{name}/decline`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)`. - public func declineAgentLogin(_ input: Operations.DeclineAgentLogin.Input) async throws -> Operations.DeclineAgentLogin.Output { + /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/decline`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)`. + public func declineAgentHeldAction(_ input: Operations.DeclineAgentHeldAction.Input) async throws -> Operations.DeclineAgentHeldAction.Output { try await client.send( input: input, - forOperation: Operations.DeclineAgentLogin.id, + forOperation: Operations.DeclineAgentHeldAction.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/logins/{}/decline", + template: "/v1/agents/{}/held-actions/{}/decline", parameters: [ input.path.id, - input.path.name + input.path.actionId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -12107,15 +12108,44 @@ public struct Client: APIProtocol { in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentHeldAction.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.HeldAction.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.BadRequest.Body + let body: Operations.DeclineAgentHeldAction.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12137,7 +12167,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.Unauthorized.Body + let body: Operations.DeclineAgentHeldAction.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12159,7 +12189,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.NotFound.Body + let body: Operations.DeclineAgentHeldAction.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12181,7 +12211,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.MethodNotAllowed.Body + let body: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12203,7 +12233,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.Conflict.Body + let body: Operations.DeclineAgentHeldAction.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12225,7 +12255,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.ContentTooLarge.Body + let body: Operations.DeclineAgentHeldAction.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12247,7 +12277,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.InternalServerError.Body + let body: Operations.DeclineAgentHeldAction.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12269,7 +12299,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeclineAgentLogin.Output.ServiceUnavailable.Body + let body: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12301,20 +12331,19 @@ public struct Client: APIProtocol { } ) } - /// Fills of the login's fields in the last 90 days, newest first. Page with `before` set to the last use's ID. + /// The logins the bot's desktop jobs can fill into web pages, and its requests for logins the owner has not answered. Values are never returned. /// - /// - Remark: HTTP `GET /v1/agents/{id}/logins/{name}/uses`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)`. - public func listAgentLoginUses(_ input: Operations.ListAgentLoginUses.Input) async throws -> Operations.ListAgentLoginUses.Output { + /// - Remark: HTTP `GET /v1/agents/{id}/logins`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)`. + public func listAgentLogins(_ input: Operations.ListAgentLogins.Input) async throws -> Operations.ListAgentLogins.Output { try await client.send( input: input, - forOperation: Operations.ListAgentLoginUses.id, + forOperation: Operations.ListAgentLogins.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/logins/{}/uses", + template: "/v1/agents/{}/logins", parameters: [ - input.path.id, - input.path.name + input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -12322,20 +12351,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "limit", - value: input.query.limit - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "before", - value: input.query.before - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -12346,7 +12361,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.Ok.Body + let body: Operations.ListAgentLogins.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12356,7 +12371,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.LoginUse].self, + Components.Schemas.Logins.self, from: responseBody, transforming: { value in .json(value) @@ -12368,7 +12383,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.BadRequest.Body + let body: Operations.ListAgentLogins.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12390,7 +12405,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.Unauthorized.Body + let body: Operations.ListAgentLogins.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12412,7 +12427,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.NotFound.Body + let body: Operations.ListAgentLogins.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12434,7 +12449,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.MethodNotAllowed.Body + let body: Operations.ListAgentLogins.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12456,7 +12471,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.Conflict.Body + let body: Operations.ListAgentLogins.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12478,7 +12493,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.ContentTooLarge.Body + let body: Operations.ListAgentLogins.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12500,7 +12515,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.InternalServerError.Body + let body: Operations.ListAgentLogins.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12522,7 +12537,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentLoginUses.Output.ServiceUnavailable.Body + let body: Operations.ListAgentLogins.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12554,35 +12569,47 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/agents/{id}/memories`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)`. - public func listAgentMemories(_ input: Operations.ListAgentMemories.Input) async throws -> Operations.ListAgentMemories.Output { + /// Creates or updates a login. Saving one the bot requested answers the request and starts a bot turn with a notice. Each field is a value stored in Crumble or a password manager reference; a 1Password `item` fills every field. Every reference is read once to check it, and nothing is saved if one fails. + /// + /// - Remark: HTTP `PUT /v1/agents/{id}/logins/{name}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)`. + public func saveAgentLogin(_ input: Operations.SaveAgentLogin.Input) async throws -> Operations.SaveAgentLogin.Output { try await client.send( input: input, - forOperation: Operations.ListAgentMemories.id, + forOperation: Operations.SaveAgentLogin.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/memories", + template: "/v1/agents/{}/logins/{}", parameters: [ - input.path.id + input.path.id, + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.Ok.Body + let body: Operations.SaveAgentLogin.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12592,7 +12619,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Memory].self, + Components.Schemas.Login.self, from: responseBody, transforming: { value in .json(value) @@ -12604,7 +12631,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.BadRequest.Body + let body: Operations.SaveAgentLogin.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12626,7 +12653,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.Unauthorized.Body + let body: Operations.SaveAgentLogin.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12648,7 +12675,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.NotFound.Body + let body: Operations.SaveAgentLogin.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12670,7 +12697,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.MethodNotAllowed.Body + let body: Operations.SaveAgentLogin.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12692,7 +12719,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.Conflict.Body + let body: Operations.SaveAgentLogin.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12714,7 +12741,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.ContentTooLarge.Body + let body: Operations.SaveAgentLogin.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12736,7 +12763,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.InternalServerError.Body + let body: Operations.SaveAgentLogin.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12758,7 +12785,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentMemories.Output.ServiceUnavailable.Body + let body: Operations.SaveAgentLogin.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12790,44 +12817,2162 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `POST /v1/agents/{id}/memories`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)`. - public func createAgentMemory(_ input: Operations.CreateAgentMemory.Input) async throws -> Operations.CreateAgentMemory.Output { + /// Deletes a login and its fill records, or declines a request for one, which starts a bot turn with a notice. + /// + /// - Remark: HTTP `DELETE /v1/agents/{id}/logins/{name}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)`. + public func deleteAgentLogin(_ input: Operations.DeleteAgentLogin.Input) async throws -> Operations.DeleteAgentLogin.Output { try await client.send( input: input, - forOperation: Operations.CreateAgentMemory.id, + forOperation: Operations.DeleteAgentLogin.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/memories", + template: "/v1/agents/{}/logins/{}", parameters: [ - input.path.id + input.path.id, + input.path.name ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] ) - } - return (request, body) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentLogin.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Declines a pending login request without changing a saved login. + /// + /// - Remark: HTTP `POST /v1/agents/{id}/logins/{name}/decline`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)`. + public func declineAgentLogin(_ input: Operations.DeclineAgentLogin.Input) async throws -> Operations.DeclineAgentLogin.Output { + try await client.send( + input: input, + forOperation: Operations.DeclineAgentLogin.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/logins/{}/decline", + parameters: [ + input.path.id, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeclineAgentLogin.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Fills of the login's fields in the last 90 days, newest first. Page with `before` set to the last use's ID. + /// + /// - Remark: HTTP `GET /v1/agents/{id}/logins/{name}/uses`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)`. + public func listAgentLoginUses(_ input: Operations.ListAgentLoginUses.Input) async throws -> Operations.ListAgentLoginUses.Output { + try await client.send( + input: input, + forOperation: Operations.ListAgentLoginUses.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/logins/{}/uses", + parameters: [ + input.path.id, + input.path.name + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.LoginUse].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentLoginUses.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `GET /v1/agents/{id}/memories`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)`. + public func listAgentMemories(_ input: Operations.ListAgentMemories.Input) async throws -> Operations.ListAgentMemories.Output { + try await client.send( + input: input, + forOperation: Operations.ListAgentMemories.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/memories", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.Memory].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentMemories.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /v1/agents/{id}/memories`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)`. + public func createAgentMemory(_ input: Operations.CreateAgentMemory.Input) async throws -> Operations.CreateAgentMemory.Output { + try await client.send( + input: input, + forOperation: Operations.CreateAgentMemory.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/memories", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 201: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.Created.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Memory.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .created(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.CreateAgentMemory.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `PATCH /v1/agents/{id}/memories/{memoryId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)`. + public func updateAgentMemory(_ input: Operations.UpdateAgentMemory.Input) async throws -> Operations.UpdateAgentMemory.Output { + try await client.send( + input: input, + forOperation: Operations.UpdateAgentMemory.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/memories/{}", + parameters: [ + input.path.id, + input.path.memoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .patch + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload?.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentMemory.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `DELETE /v1/agents/{id}/memories/{memoryId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)`. + public func deleteAgentMemory(_ input: Operations.DeleteAgentMemory.Input) async throws -> Operations.DeleteAgentMemory.Output { + try await client.send( + input: input, + forOperation: Operations.DeleteAgentMemory.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/memories/{}", + parameters: [ + input.path.id, + input.path.memoryId + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.DeleteAgentMemory.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// - Remark: HTTP `POST /v1/agents/{id}/messages`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)`. + public func sendMessage(_ input: Operations.SendMessage.Input) async throws -> Operations.SendMessage.Output { + try await client.send( + input: input, + forOperation: Operations.SendMessage.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/messages", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 202: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.Accepted.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.Execution.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .accepted(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.SendMessage.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// What the bot's reviews changed, newest first, one entry per reviewed execution with its changes. Clients show these as notices in the bot chat, also after reconnecting. + /// + /// - Remark: HTTP `GET /v1/agents/{id}/reviews`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)`. + public func listAgentReviews(_ input: Operations.ListAgentReviews.Input) async throws -> Operations.ListAgentReviews.Output { + try await client.send( + input: input, + forOperation: Operations.ListAgentReviews.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/reviews", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.ReviewResult].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListAgentReviews.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// The bot's own skill packages, including stale and archived ones. The agent's inline `skills` field lists the same skills by name and instructions. + /// + /// - Remark: HTTP `GET /v1/agents/{id}/skills`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)`. + public func listAgentSkills(_ input: Operations.ListAgentSkills.Input) async throws -> Operations.ListAgentSkills.Output { + try await client.send( + input: input, + forOperation: Operations.ListAgentSkills.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/agents/{}/skills", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .get + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.Created.Body + let body: Operations.ListAgentSkills.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12837,7 +14982,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Memory.self, + [Components.Schemas.SkillPackage].self, from: responseBody, transforming: { value in .json(value) @@ -12846,10 +14991,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.BadRequest.Body + let body: Operations.ListAgentSkills.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12871,7 +15016,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.Unauthorized.Body + let body: Operations.ListAgentSkills.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12893,7 +15038,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.NotFound.Body + let body: Operations.ListAgentSkills.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12915,7 +15060,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.MethodNotAllowed.Body + let body: Operations.ListAgentSkills.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12937,7 +15082,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.Conflict.Body + let body: Operations.ListAgentSkills.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12959,7 +15104,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.ContentTooLarge.Body + let body: Operations.ListAgentSkills.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -12981,7 +15126,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.InternalServerError.Body + let body: Operations.ListAgentSkills.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13003,7 +15148,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentMemory.Output.ServiceUnavailable.Body + let body: Operations.ListAgentSkills.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13035,23 +15180,22 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `PATCH /v1/agents/{id}/memories/{memoryId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)`. - public func updateAgentMemory(_ input: Operations.UpdateAgentMemory.Input) async throws -> Operations.UpdateAgentMemory.Output { + /// - Remark: HTTP `POST /v1/agents/{id}/skills`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)`. + public func createAgentSkill(_ input: Operations.CreateAgentSkill.Input) async throws -> Operations.CreateAgentSkill.Output { try await client.send( input: input, - forOperation: Operations.UpdateAgentMemory.id, + forOperation: Operations.CreateAgentSkill.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/memories/{}", + template: "/v1/agents/{}/skills", parameters: [ - input.path.id, - input.path.memoryId + input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -13071,9 +15215,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.Ok.Body + let body: Operations.CreateAgentSkill.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13083,7 +15227,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload?.self, + Components.Schemas.SkillPackage.self, from: responseBody, transforming: { value in .json(value) @@ -13092,10 +15236,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.BadRequest.Body + let body: Operations.CreateAgentSkill.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13117,7 +15261,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.Unauthorized.Body + let body: Operations.CreateAgentSkill.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13139,7 +15283,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.NotFound.Body + let body: Operations.CreateAgentSkill.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13161,7 +15305,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.MethodNotAllowed.Body + let body: Operations.CreateAgentSkill.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13183,7 +15327,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.Conflict.Body + let body: Operations.CreateAgentSkill.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13205,7 +15349,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.ContentTooLarge.Body + let body: Operations.CreateAgentSkill.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13227,7 +15371,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.InternalServerError.Body + let body: Operations.CreateAgentSkill.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13249,7 +15393,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentMemory.Output.ServiceUnavailable.Body + let body: Operations.CreateAgentSkill.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13281,38 +15425,69 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `DELETE /v1/agents/{id}/memories/{memoryId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)`. - public func deleteAgentMemory(_ input: Operations.DeleteAgentMemory.Input) async throws -> Operations.DeleteAgentMemory.Output { + /// Changes a skill's content, restores an archived skill by setting state to active, or pins it so the curator never marks it stale or archives it. + /// + /// - Remark: HTTP `PATCH /v1/agents/{id}/skills/{skillId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)`. + public func updateAgentSkill(_ input: Operations.UpdateAgentSkill.Input) async throws -> Operations.UpdateAgentSkill.Output { try await client.send( input: input, - forOperation: Operations.DeleteAgentMemory.id, + forOperation: Operations.UpdateAgentSkill.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/memories/{}", + template: "/v1/agents/{}/skills/{}", parameters: [ input.path.id, - input.path.memoryId + input.path.skillId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.UpdateAgentSkill.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload?.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.BadRequest.Body + let body: Operations.UpdateAgentSkill.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13334,7 +15509,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.Unauthorized.Body + let body: Operations.UpdateAgentSkill.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13356,7 +15531,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.NotFound.Body + let body: Operations.UpdateAgentSkill.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13378,7 +15553,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.MethodNotAllowed.Body + let body: Operations.UpdateAgentSkill.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13400,7 +15575,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.Conflict.Body + let body: Operations.UpdateAgentSkill.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13422,7 +15597,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.ContentTooLarge.Body + let body: Operations.UpdateAgentSkill.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13444,7 +15619,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.InternalServerError.Body + let body: Operations.UpdateAgentSkill.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13466,7 +15641,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentMemory.Output.ServiceUnavailable.Body + let body: Operations.UpdateAgentSkill.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13498,66 +15673,38 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `POST /v1/agents/{id}/messages`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)`. - public func sendMessage(_ input: Operations.SendMessage.Input) async throws -> Operations.SendMessage.Output { + /// - Remark: HTTP `DELETE /v1/agents/{id}/skills/{skillId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)`. + public func deleteAgentSkill(_ input: Operations.DeleteAgentSkill.Input) async throws -> Operations.DeleteAgentSkill.Output { try await client.send( input: input, - forOperation: Operations.SendMessage.id, + forOperation: Operations.DeleteAgentSkill.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/messages", + template: "/v1/agents/{}/skills/{}", parameters: [ - input.path.id + input.path.id, + input.path.skillId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 202: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.Accepted.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Execution.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .accepted(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.BadRequest.Body + let body: Operations.DeleteAgentSkill.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13579,7 +15726,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.Unauthorized.Body + let body: Operations.DeleteAgentSkill.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13601,7 +15748,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.NotFound.Body + let body: Operations.DeleteAgentSkill.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13623,7 +15770,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.MethodNotAllowed.Body + let body: Operations.DeleteAgentSkill.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13645,7 +15792,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.Conflict.Body + let body: Operations.DeleteAgentSkill.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13667,7 +15814,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.ContentTooLarge.Body + let body: Operations.DeleteAgentSkill.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13689,7 +15836,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.InternalServerError.Body + let body: Operations.DeleteAgentSkill.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13711,7 +15858,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SendMessage.Output.ServiceUnavailable.Body + let body: Operations.DeleteAgentSkill.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13743,33 +15890,22 @@ public struct Client: APIProtocol { } ) } - /// What the bot's reviews changed, newest first, one entry per reviewed execution with its changes. Clients show these as notices in the bot chat, also after reconnecting. - /// - /// - Remark: HTTP `GET /v1/agents/{id}/reviews`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)`. - public func listAgentReviews(_ input: Operations.ListAgentReviews.Input) async throws -> Operations.ListAgentReviews.Output { + /// - Remark: HTTP `GET /v1/capabilities`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)`. + public func getCapabilities(_ input: Operations.GetCapabilities.Input) async throws -> Operations.GetCapabilities.Output { try await client.send( input: input, - forOperation: Operations.ListAgentReviews.id, + forOperation: Operations.GetCapabilities.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/reviews", - parameters: [ - input.path.id - ] + template: "/v1/capabilities", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "limit", - value: input.query.limit - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -13780,7 +15916,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.Ok.Body + let body: Operations.GetCapabilities.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13790,7 +15926,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.ReviewResult].self, + Components.Schemas.Capabilities.self, from: responseBody, transforming: { value in .json(value) @@ -13802,7 +15938,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.BadRequest.Body + let body: Operations.GetCapabilities.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13824,7 +15960,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.Unauthorized.Body + let body: Operations.GetCapabilities.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13846,7 +15982,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.NotFound.Body + let body: Operations.GetCapabilities.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13868,7 +16004,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.MethodNotAllowed.Body + let body: Operations.GetCapabilities.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13890,7 +16026,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.Conflict.Body + let body: Operations.GetCapabilities.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13912,7 +16048,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.ContentTooLarge.Body + let body: Operations.GetCapabilities.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13934,7 +16070,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.InternalServerError.Body + let body: Operations.GetCapabilities.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13956,7 +16092,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentReviews.Output.ServiceUnavailable.Body + let body: Operations.GetCapabilities.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -13988,26 +16124,45 @@ public struct Client: APIProtocol { } ) } - /// The bot's own skill packages, including stale and archived ones. The agent's inline `skills` field lists the same skills by name and instructions. + /// Skill and memory changes by owners, bots, and reviews, newest first, with the state before and after each. Page with `before` set to the last change's ID. /// - /// - Remark: HTTP `GET /v1/agents/{id}/skills`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)`. - public func listAgentSkills(_ input: Operations.ListAgentSkills.Input) async throws -> Operations.ListAgentSkills.Output { + /// - Remark: HTTP `GET /v1/changes`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)`. + public func listChanges(_ input: Operations.ListChanges.Input) async throws -> Operations.ListChanges.Output { try await client.send( input: input, - forOperation: Operations.ListAgentSkills.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/v1/agents/{}/skills", - parameters: [ - input.path.id - ] + forOperation: Operations.ListChanges.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/changes", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "agentId", + value: input.query.agentId + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -14018,7 +16173,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.Ok.Body + let body: Operations.ListChanges.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14028,7 +16183,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.SkillPackage].self, + [Components.Schemas.LearnedChange].self, from: responseBody, transforming: { value in .json(value) @@ -14040,7 +16195,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.BadRequest.Body + let body: Operations.ListChanges.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14062,7 +16217,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.Unauthorized.Body + let body: Operations.ListChanges.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14084,7 +16239,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.NotFound.Body + let body: Operations.ListChanges.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14106,7 +16261,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.MethodNotAllowed.Body + let body: Operations.ListChanges.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14128,7 +16283,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.Conflict.Body + let body: Operations.ListChanges.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14150,7 +16305,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.ContentTooLarge.Body + let body: Operations.ListChanges.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14172,7 +16327,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.InternalServerError.Body + let body: Operations.ListChanges.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14194,7 +16349,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListAgentSkills.Output.ServiceUnavailable.Body + let body: Operations.ListChanges.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14226,15 +16381,17 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `POST /v1/agents/{id}/skills`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)`. - public func createAgentSkill(_ input: Operations.CreateAgentSkill.Input) async throws -> Operations.CreateAgentSkill.Output { + /// Restores the state before the change, whatever happened since, and records the revert as a change of its own. + /// + /// - Remark: HTTP `POST /v1/changes/{id}/revert`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)`. + public func revertChange(_ input: Operations.RevertChange.Input) async throws -> Operations.RevertChange.Output { try await client.send( input: input, - forOperation: Operations.CreateAgentSkill.id, + forOperation: Operations.RevertChange.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/skills", + template: "/v1/changes/{}/revert", parameters: [ input.path.id ] @@ -14248,22 +16405,13 @@ public struct Client: APIProtocol { in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.Created.Body + let body: Operations.RevertChange.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14273,7 +16421,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.SkillPackage.self, + Components.Schemas.LearnedChange.self, from: responseBody, transforming: { value in .json(value) @@ -14285,7 +16433,7 @@ public struct Client: APIProtocol { return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.BadRequest.Body + let body: Operations.RevertChange.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14307,7 +16455,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.Unauthorized.Body + let body: Operations.RevertChange.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14329,7 +16477,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.NotFound.Body + let body: Operations.RevertChange.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14351,7 +16499,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.MethodNotAllowed.Body + let body: Operations.RevertChange.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14373,7 +16521,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.Conflict.Body + let body: Operations.RevertChange.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14395,7 +16543,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.ContentTooLarge.Body + let body: Operations.RevertChange.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14417,7 +16565,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.InternalServerError.Body + let body: Operations.RevertChange.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14439,7 +16587,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateAgentSkill.Output.ServiceUnavailable.Body + let body: Operations.RevertChange.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14471,25 +16619,20 @@ public struct Client: APIProtocol { } ) } - /// Changes a skill's content, restores an archived skill by setting state to active, or pins it so the curator never marks it stale or archives it. - /// - /// - Remark: HTTP `PATCH /v1/agents/{id}/skills/{skillId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)`. - public func updateAgentSkill(_ input: Operations.UpdateAgentSkill.Input) async throws -> Operations.UpdateAgentSkill.Output { + /// - Remark: HTTP `POST /v1/chat-attention/seen`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)`. + public func postChatAttentionSeen(_ input: Operations.PostChatAttentionSeen.Input) async throws -> Operations.PostChatAttentionSeen.Output { try await client.send( input: input, - forOperation: Operations.UpdateAgentSkill.id, + forOperation: Operations.PostChatAttentionSeen.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/skills/{}", - parameters: [ - input.path.id, - input.path.skillId - ] + template: "/v1/chat-attention/seen", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -14509,31 +16652,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload?.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.BadRequest.Body + let body: Operations.PostChatAttentionSeen.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14555,7 +16678,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.Unauthorized.Body + let body: Operations.PostChatAttentionSeen.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14577,7 +16700,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.NotFound.Body + let body: Operations.PostChatAttentionSeen.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14599,7 +16722,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.MethodNotAllowed.Body + let body: Operations.PostChatAttentionSeen.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14621,7 +16744,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.Conflict.Body + let body: Operations.PostChatAttentionSeen.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14643,7 +16766,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.ContentTooLarge.Body + let body: Operations.PostChatAttentionSeen.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14665,7 +16788,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.InternalServerError.Body + let body: Operations.PostChatAttentionSeen.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14687,7 +16810,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateAgentSkill.Output.ServiceUnavailable.Body + let body: Operations.PostChatAttentionSeen.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14719,30 +16842,38 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `DELETE /v1/agents/{id}/skills/{skillId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)`. - public func deleteAgentSkill(_ input: Operations.DeleteAgentSkill.Input) async throws -> Operations.DeleteAgentSkill.Output { + /// - Remark: HTTP `PUT /v1/chat-attention/views/{viewId}`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)`. + public func putChatAttentionView(_ input: Operations.PutChatAttentionView.Input) async throws -> Operations.PutChatAttentionView.Output { try await client.send( input: input, - forOperation: Operations.DeleteAgentSkill.id, + forOperation: Operations.PutChatAttentionView.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/agents/{}/skills/{}", + template: "/v1/chat-attention/views/{}", parameters: [ - input.path.id, - input.path.skillId + input.path.viewId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { @@ -14750,7 +16881,7 @@ public struct Client: APIProtocol { return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.BadRequest.Body + let body: Operations.PutChatAttentionView.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14772,7 +16903,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.Unauthorized.Body + let body: Operations.PutChatAttentionView.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14794,7 +16925,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.NotFound.Body + let body: Operations.PutChatAttentionView.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14816,7 +16947,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.MethodNotAllowed.Body + let body: Operations.PutChatAttentionView.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14838,7 +16969,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.Conflict.Body + let body: Operations.PutChatAttentionView.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14860,7 +16991,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.ContentTooLarge.Body + let body: Operations.PutChatAttentionView.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14882,7 +17013,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.InternalServerError.Body + let body: Operations.PutChatAttentionView.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14904,7 +17035,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteAgentSkill.Output.ServiceUnavailable.Body + let body: Operations.PutChatAttentionView.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14936,15 +17067,17 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/capabilities`. - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)`. - public func getCapabilities(_ input: Operations.GetCapabilities.Input) async throws -> Operations.GetCapabilities.Output { + /// The account's event relay: its URL, whether the Doorstep account token is set (plugin setting `doorstep:token`), and the connection status. + /// + /// - Remark: HTTP `GET /v1/event-relay`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)`. + public func getEventRelay(_ input: Operations.GetEventRelay.Input) async throws -> Operations.GetEventRelay.Output { try await client.send( input: input, - forOperation: Operations.GetCapabilities.id, + forOperation: Operations.GetEventRelay.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/capabilities", + template: "/v1/event-relay", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( @@ -14962,7 +17095,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.Ok.Body + let body: Operations.GetEventRelay.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -14972,7 +17105,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.Capabilities.self, + Operations.GetEventRelay.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -14984,7 +17117,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.BadRequest.Body + let body: Operations.GetEventRelay.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15006,7 +17139,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.Unauthorized.Body + let body: Operations.GetEventRelay.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15028,7 +17161,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.NotFound.Body + let body: Operations.GetEventRelay.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15050,7 +17183,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.MethodNotAllowed.Body + let body: Operations.GetEventRelay.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15072,7 +17205,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.Conflict.Body + let body: Operations.GetEventRelay.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15094,7 +17227,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.ContentTooLarge.Body + let body: Operations.GetEventRelay.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15116,7 +17249,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.InternalServerError.Body + let body: Operations.GetEventRelay.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15138,7 +17271,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetCapabilities.Output.ServiceUnavailable.Body + let body: Operations.GetEventRelay.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15170,56 +17303,44 @@ public struct Client: APIProtocol { } ) } - /// Skill and memory changes by owners, bots, and reviews, newest first, with the state before and after each. Page with `before` set to the last change's ID. + /// Sets the event relay URL, or removes it with `null`, which disconnects the relay. /// - /// - Remark: HTTP `GET /v1/changes`. - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)`. - public func listChanges(_ input: Operations.ListChanges.Input) async throws -> Operations.ListChanges.Output { + /// - Remark: HTTP `PUT /v1/event-relay`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)`. + public func updateEventRelay(_ input: Operations.UpdateEventRelay.Input) async throws -> Operations.UpdateEventRelay.Output { try await client.send( input: input, - forOperation: Operations.ListChanges.id, + forOperation: Operations.UpdateEventRelay.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/changes", + template: "/v1/event-relay", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "limit", - value: input.query.limit - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "before", - value: input.query.before - ) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "agentId", - value: input.query.agentId - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.Ok.Body + let body: Operations.UpdateEventRelay.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15229,7 +17350,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.LearnedChange].self, + Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -15241,7 +17362,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.BadRequest.Body + let body: Operations.UpdateEventRelay.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15263,7 +17384,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.Unauthorized.Body + let body: Operations.UpdateEventRelay.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15285,7 +17406,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.NotFound.Body + let body: Operations.UpdateEventRelay.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15307,7 +17428,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.MethodNotAllowed.Body + let body: Operations.UpdateEventRelay.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15329,7 +17450,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.Conflict.Body + let body: Operations.UpdateEventRelay.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15351,7 +17472,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.ContentTooLarge.Body + let body: Operations.UpdateEventRelay.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15373,7 +17494,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.InternalServerError.Body + let body: Operations.UpdateEventRelay.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15395,7 +17516,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListChanges.Output.ServiceUnavailable.Body + let body: Operations.UpdateEventRelay.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15427,24 +17548,22 @@ public struct Client: APIProtocol { } ) } - /// Restores the state before the change, whatever happened since, and records the revert as a change of its own. + /// The account's event sources, each with the number of automations that use it. /// - /// - Remark: HTTP `POST /v1/changes/{id}/revert`. - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)`. - public func revertChange(_ input: Operations.RevertChange.Input) async throws -> Operations.RevertChange.Output { + /// - Remark: HTTP `GET /v1/event-sources`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)`. + public func listEventSources(_ input: Operations.ListEventSources.Input) async throws -> Operations.ListEventSources.Output { try await client.send( input: input, - forOperation: Operations.RevertChange.id, + forOperation: Operations.ListEventSources.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/changes/{}/revert", - parameters: [ - input.path.id - ] + template: "/v1/event-sources", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -15455,9 +17574,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.Created.Body + let body: Operations.ListEventSources.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15467,7 +17586,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.LearnedChange.self, + Operations.ListEventSources.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -15476,10 +17595,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.BadRequest.Body + let body: Operations.ListEventSources.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15501,7 +17620,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.Unauthorized.Body + let body: Operations.ListEventSources.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15523,7 +17642,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.NotFound.Body + let body: Operations.ListEventSources.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15545,7 +17664,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.MethodNotAllowed.Body + let body: Operations.ListEventSources.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15567,7 +17686,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.Conflict.Body + let body: Operations.ListEventSources.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15589,7 +17708,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.ContentTooLarge.Body + let body: Operations.ListEventSources.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15611,7 +17730,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.InternalServerError.Body + let body: Operations.ListEventSources.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15633,7 +17752,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.RevertChange.Output.ServiceUnavailable.Body + let body: Operations.ListEventSources.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15665,35 +17784,44 @@ public struct Client: APIProtocol { } ) } - /// The account's event relay: its URL, whether the Doorstep account token is set (plugin setting `doorstep:token`), and the connection status. + /// Creates a source on the event relay. The response's `address` contains the source's secret and is returned only once. 400 when the relay URL or token is missing, or the relay can't be reached or rejects the token. /// - /// - Remark: HTTP `GET /v1/event-relay`. - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)`. - public func getEventRelay(_ input: Operations.GetEventRelay.Input) async throws -> Operations.GetEventRelay.Output { + /// - Remark: HTTP `POST /v1/event-sources`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)`. + public func createEventSource(_ input: Operations.CreateEventSource.Input) async throws -> Operations.CreateEventSource.Output { try await client.send( input: input, - forOperation: Operations.GetEventRelay.id, + forOperation: Operations.CreateEventSource.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/event-relay", + template: "/v1/event-sources", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.Ok.Body + let body: Operations.CreateEventSource.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15703,7 +17831,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.GetEventRelay.Output.Ok.Body.JsonPayload.self, + Operations.CreateEventSource.Output.Created.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -15712,10 +17840,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.BadRequest.Body + let body: Operations.CreateEventSource.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15737,7 +17865,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.Unauthorized.Body + let body: Operations.CreateEventSource.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15759,7 +17887,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.NotFound.Body + let body: Operations.CreateEventSource.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15781,7 +17909,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.MethodNotAllowed.Body + let body: Operations.CreateEventSource.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15803,7 +17931,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.Conflict.Body + let body: Operations.CreateEventSource.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15825,7 +17953,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.ContentTooLarge.Body + let body: Operations.CreateEventSource.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15847,7 +17975,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.InternalServerError.Body + let body: Operations.CreateEventSource.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15869,7 +17997,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetEventRelay.Output.ServiceUnavailable.Body + let body: Operations.CreateEventSource.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15901,66 +18029,39 @@ public struct Client: APIProtocol { } ) } - /// Sets the event relay URL, or removes it with `null`, which disconnects the relay. + /// Deletes the source on the event relay and in Crumble; its address stops working. 409 while an automation uses it. /// - /// - Remark: HTTP `PUT /v1/event-relay`. - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)`. - public func updateEventRelay(_ input: Operations.UpdateEventRelay.Input) async throws -> Operations.UpdateEventRelay.Output { + /// - Remark: HTTP `DELETE /v1/event-sources/{id}`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)`. + public func deleteEventSource(_ input: Operations.DeleteEventSource.Input) async throws -> Operations.DeleteEventSource.Output { try await client.send( input: input, - forOperation: Operations.UpdateEventRelay.id, + forOperation: Operations.DeleteEventSource.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/event-relay", - parameters: [] + template: "/v1/event-sources/{}", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.BadRequest.Body + let body: Operations.DeleteEventSource.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -15982,7 +18083,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.Unauthorized.Body + let body: Operations.DeleteEventSource.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16004,7 +18105,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.NotFound.Body + let body: Operations.DeleteEventSource.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16026,7 +18127,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.MethodNotAllowed.Body + let body: Operations.DeleteEventSource.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16048,7 +18149,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.Conflict.Body + let body: Operations.DeleteEventSource.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16070,7 +18171,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.ContentTooLarge.Body + let body: Operations.DeleteEventSource.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16092,7 +18193,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.InternalServerError.Body + let body: Operations.DeleteEventSource.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16114,7 +18215,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateEventRelay.Output.ServiceUnavailable.Body + let body: Operations.DeleteEventSource.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16146,17 +18247,17 @@ public struct Client: APIProtocol { } ) } - /// The account's event sources, each with the number of automations that use it. + /// Server-sent events. Each activity event carries a ReplyEvent or ChatPreviewEvent JSON object in data. Each learned event carries a LearnedEvent: what a bot's review of one turn changed; GET /v1/agents/{id}/reviews lists them durably. Current chat previews replay on connection; finished replies and learned events are not replayed. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. No Last-Event-ID replay. /// - /// - Remark: HTTP `GET /v1/event-sources`. - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)`. - public func listEventSources(_ input: Operations.ListEventSources.Input) async throws -> Operations.ListEventSources.Output { + /// - Remark: HTTP `GET /v1/events`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)`. + public func streamActivityEvents(_ input: Operations.StreamActivityEvents.Input) async throws -> Operations.StreamActivityEvents.Output { try await client.send( input: input, - forOperation: Operations.ListEventSources.id, + forOperation: Operations.StreamActivityEvents.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/event-sources", + template: "/v1/events", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( @@ -16174,20 +18275,20 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.Ok.Body + let body: Operations.StreamActivityEvents.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "text/event-stream" ] ) switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Operations.ListEventSources.Output.Ok.Body.JsonPayload.self, + case "text/event-stream": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, from: responseBody, transforming: { value in - .json(value) + .textEventStream(value) } ) default: @@ -16196,7 +18297,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.BadRequest.Body + let body: Operations.StreamActivityEvents.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16218,7 +18319,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.Unauthorized.Body + let body: Operations.StreamActivityEvents.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16240,7 +18341,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.NotFound.Body + let body: Operations.StreamActivityEvents.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16262,7 +18363,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.MethodNotAllowed.Body + let body: Operations.StreamActivityEvents.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16284,7 +18385,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.Conflict.Body + let body: Operations.StreamActivityEvents.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16306,7 +18407,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.ContentTooLarge.Body + let body: Operations.StreamActivityEvents.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16328,7 +18429,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.InternalServerError.Body + let body: Operations.StreamActivityEvents.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16350,7 +18451,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListEventSources.Output.ServiceUnavailable.Body + let body: Operations.StreamActivityEvents.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16382,44 +18483,40 @@ public struct Client: APIProtocol { } ) } - /// Creates a source on the event relay. The response's `address` contains the source's secret and is returned only once. 400 when the relay URL or token is missing, or the relay can't be reached or rejects the token. - /// - /// - Remark: HTTP `POST /v1/event-sources`. - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)`. - public func createEventSource(_ input: Operations.CreateEventSource.Input) async throws -> Operations.CreateEventSource.Output { + /// - Remark: HTTP `GET /v1/executions`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)`. + public func listExecutions(_ input: Operations.ListExecutions.Input) async throws -> Operations.ListExecutions.Output { try await client.send( input: input, - forOperation: Operations.CreateEventSource.id, + forOperation: Operations.ListExecutions.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/event-sources", + template: "/v1/executions", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "agentId", + value: input.query.agentId + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: + case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.Created.Body + let body: Operations.ListExecutions.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16429,7 +18526,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CreateEventSource.Output.Created.Body.JsonPayload.self, + [Components.Schemas.Execution].self, from: responseBody, transforming: { value in .json(value) @@ -16438,10 +18535,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .created(.init(body: body)) + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.BadRequest.Body + let body: Operations.ListExecutions.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16463,7 +18560,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.Unauthorized.Body + let body: Operations.ListExecutions.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16485,7 +18582,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.NotFound.Body + let body: Operations.ListExecutions.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16507,7 +18604,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.MethodNotAllowed.Body + let body: Operations.ListExecutions.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16529,7 +18626,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.Conflict.Body + let body: Operations.ListExecutions.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16551,7 +18648,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.ContentTooLarge.Body + let body: Operations.ListExecutions.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16573,7 +18670,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.InternalServerError.Body + let body: Operations.ListExecutions.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16595,7 +18692,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateEventSource.Output.ServiceUnavailable.Body + let body: Operations.ListExecutions.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16627,24 +18724,22 @@ public struct Client: APIProtocol { } ) } - /// Deletes the source on the event relay and in Crumble; its address stops working. 409 while an automation uses it. + /// The account's machine accounts: GitHub users made for bots. A bot acts as its machine account wherever none of its GitHub Apps does. /// - /// - Remark: HTTP `DELETE /v1/event-sources/{id}`. - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)`. - public func deleteEventSource(_ input: Operations.DeleteEventSource.Input) async throws -> Operations.DeleteEventSource.Output { + /// - Remark: HTTP `GET /v1/github-accounts`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)`. + public func listGithubAccounts(_ input: Operations.ListGithubAccounts.Input) async throws -> Operations.ListGithubAccounts.Output { try await client.send( input: input, - forOperation: Operations.DeleteEventSource.id, + forOperation: Operations.ListGithubAccounts.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/event-sources/{}", - parameters: [ - input.path.id - ] + template: "/v1/github-accounts", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -16655,11 +18750,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListGithubAccounts.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ListGithubAccounts.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.BadRequest.Body + let body: Operations.ListGithubAccounts.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16681,7 +18796,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.Unauthorized.Body + let body: Operations.ListGithubAccounts.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16703,7 +18818,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.NotFound.Body + let body: Operations.ListGithubAccounts.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16725,7 +18840,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.MethodNotAllowed.Body + let body: Operations.ListGithubAccounts.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16747,7 +18862,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.Conflict.Body + let body: Operations.ListGithubAccounts.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16769,7 +18884,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.ContentTooLarge.Body + let body: Operations.ListGithubAccounts.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16791,7 +18906,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.InternalServerError.Body + let body: Operations.ListGithubAccounts.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16813,7 +18928,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteEventSource.Output.ServiceUnavailable.Body + let body: Operations.ListGithubAccounts.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16845,48 +18960,57 @@ public struct Client: APIProtocol { } ) } - /// Server-sent events. Each activity event carries a ReplyEvent or ChatPreviewEvent JSON object in data. Each learned event carries a LearnedEvent: what a bot's review of one turn changed; GET /v1/agents/{id}/reviews lists them durably. Current chat previews replay on connection; finished replies and learned events are not replayed. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. No Last-Event-ID replay. + /// Adds the GitHub user a personal access token signs in as. 400 when GitHub refuses the token; 409 when the user is already added. /// - /// - Remark: HTTP `GET /v1/events`. - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)`. - public func streamActivityEvents(_ input: Operations.StreamActivityEvents.Input) async throws -> Operations.StreamActivityEvents.Output { + /// - Remark: HTTP `POST /v1/github-accounts`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)`. + public func addGithubAccount(_ input: Operations.AddGithubAccount.Input) async throws -> Operations.AddGithubAccount.Output { try await client.send( input: input, - forOperation: Operations.StreamActivityEvents.id, + forOperation: Operations.AddGithubAccount.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/events", + template: "/v1/github-accounts", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.Ok.Body + let body: Operations.AddGithubAccount.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "text/event-stream" + "application/json" ] ) switch chosenContentType { - case "text/event-stream": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.GitHubAccount.self, from: responseBody, transforming: { value in - .textEventStream(value) + .json(value) } ) default: @@ -16895,7 +19019,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.BadRequest.Body + let body: Operations.AddGithubAccount.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16917,7 +19041,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.Unauthorized.Body + let body: Operations.AddGithubAccount.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16939,7 +19063,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.NotFound.Body + let body: Operations.AddGithubAccount.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16961,7 +19085,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.MethodNotAllowed.Body + let body: Operations.AddGithubAccount.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -16983,7 +19107,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.Conflict.Body + let body: Operations.AddGithubAccount.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17005,7 +19129,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.ContentTooLarge.Body + let body: Operations.AddGithubAccount.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17027,7 +19151,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.InternalServerError.Body + let body: Operations.AddGithubAccount.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17049,7 +19173,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamActivityEvents.Output.ServiceUnavailable.Body + let body: Operations.AddGithubAccount.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17081,29 +19205,26 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/executions`. - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)`. - public func listExecutions(_ input: Operations.ListExecutions.Input) async throws -> Operations.ListExecutions.Output { + /// Forgets the machine account and its token, and takes GH_TOKEN from bots left without an installed App. The user stays on GitHub. + /// + /// - Remark: HTTP `DELETE /v1/github-accounts/{id}`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)`. + public func deleteGithubAccount(_ input: Operations.DeleteGithubAccount.Input) async throws -> Operations.DeleteGithubAccount.Output { try await client.send( input: input, - forOperation: Operations.ListExecutions.id, + forOperation: Operations.DeleteGithubAccount.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/executions", - parameters: [] + template: "/v1/github-accounts/{}", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "agentId", - value: input.query.agentId - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -17112,31 +19233,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.Execution].self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.BadRequest.Body + let body: Operations.DeleteGithubAccount.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17158,7 +19259,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.Unauthorized.Body + let body: Operations.DeleteGithubAccount.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17180,7 +19281,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.NotFound.Body + let body: Operations.DeleteGithubAccount.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17202,7 +19303,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.MethodNotAllowed.Body + let body: Operations.DeleteGithubAccount.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17224,7 +19325,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.Conflict.Body + let body: Operations.DeleteGithubAccount.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17246,7 +19347,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.ContentTooLarge.Body + let body: Operations.DeleteGithubAccount.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17268,7 +19369,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.InternalServerError.Body + let body: Operations.DeleteGithubAccount.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17290,7 +19391,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListExecutions.Output.ServiceUnavailable.Body + let body: Operations.DeleteGithubAccount.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17322,35 +19423,46 @@ public struct Client: APIProtocol { } ) } - /// The account's machine accounts: GitHub users made for bots. A bot acts as its machine account wherever none of its GitHub Apps does. + /// Replaces the bots that act as the machine account, giving them GH_TOKEN. A bot acts as at most one; 409 when a bot already acts as another. /// - /// - Remark: HTTP `GET /v1/github-accounts`. - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)`. - public func listGithubAccounts(_ input: Operations.ListGithubAccounts.Input) async throws -> Operations.ListGithubAccounts.Output { + /// - Remark: HTTP `PUT /v1/github-accounts/{id}/bots`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)`. + public func setGithubAccountBots(_ input: Operations.SetGithubAccountBots.Input) async throws -> Operations.SetGithubAccountBots.Output { try await client.send( input: input, - forOperation: Operations.ListGithubAccounts.id, + forOperation: Operations.SetGithubAccountBots.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-accounts", - parameters: [] + template: "/v1/github-accounts/{}/bots", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.Ok.Body + let body: Operations.SetGithubAccountBots.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17360,7 +19472,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ListGithubAccounts.Output.Ok.Body.JsonPayload.self, + Components.Schemas.GitHubAccount.self, from: responseBody, transforming: { value in .json(value) @@ -17372,7 +19484,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.BadRequest.Body + let body: Operations.SetGithubAccountBots.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17394,7 +19506,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.Unauthorized.Body + let body: Operations.SetGithubAccountBots.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17416,7 +19528,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.NotFound.Body + let body: Operations.SetGithubAccountBots.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17438,7 +19550,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.MethodNotAllowed.Body + let body: Operations.SetGithubAccountBots.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17460,7 +19572,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.Conflict.Body + let body: Operations.SetGithubAccountBots.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17482,7 +19594,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.ContentTooLarge.Body + let body: Operations.SetGithubAccountBots.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17504,7 +19616,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.InternalServerError.Body + let body: Operations.SetGithubAccountBots.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17526,7 +19638,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubAccounts.Output.ServiceUnavailable.Body + let body: Operations.SetGithubAccountBots.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17558,22 +19670,24 @@ public struct Client: APIProtocol { } ) } - /// Adds the GitHub user a personal access token signs in as. 400 when GitHub refuses the token; 409 when the user is already added. + /// Replaces the machine account's token. 400 when GitHub refuses it or it signs in as another user. /// - /// - Remark: HTTP `POST /v1/github-accounts`. - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)`. - public func addGithubAccount(_ input: Operations.AddGithubAccount.Input) async throws -> Operations.AddGithubAccount.Output { + /// - Remark: HTTP `PUT /v1/github-accounts/{id}/token`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)`. + public func setGithubAccountToken(_ input: Operations.SetGithubAccountToken.Input) async throws -> Operations.SetGithubAccountToken.Output { try await client.send( input: input, - forOperation: Operations.AddGithubAccount.id, + forOperation: Operations.SetGithubAccountToken.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-accounts", - parameters: [] + template: "/v1/github-accounts/{}/token", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -17595,7 +19709,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.Ok.Body + let body: Operations.SetGithubAccountToken.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17617,7 +19731,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.BadRequest.Body + let body: Operations.SetGithubAccountToken.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17639,7 +19753,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.Unauthorized.Body + let body: Operations.SetGithubAccountToken.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17661,7 +19775,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.NotFound.Body + let body: Operations.SetGithubAccountToken.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17683,7 +19797,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.MethodNotAllowed.Body + let body: Operations.SetGithubAccountToken.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17705,7 +19819,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.Conflict.Body + let body: Operations.SetGithubAccountToken.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17727,7 +19841,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.ContentTooLarge.Body + let body: Operations.SetGithubAccountToken.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17749,7 +19863,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.InternalServerError.Body + let body: Operations.SetGithubAccountToken.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17771,7 +19885,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.AddGithubAccount.Output.ServiceUnavailable.Body + let body: Operations.SetGithubAccountToken.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17803,24 +19917,22 @@ public struct Client: APIProtocol { } ) } - /// Forgets the machine account and its token, and takes GH_TOKEN from bots left without an installed App. The user stays on GitHub. + /// The account's GitHub Apps, each the GitHub identity its bots act through in one GitHub account's repositories. /// - /// - Remark: HTTP `DELETE /v1/github-accounts/{id}`. - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)`. - public func deleteGithubAccount(_ input: Operations.DeleteGithubAccount.Input) async throws -> Operations.DeleteGithubAccount.Output { + /// - Remark: HTTP `GET /v1/github-apps`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)`. + public func listGithubApps(_ input: Operations.ListGithubApps.Input) async throws -> Operations.ListGithubApps.Output { try await client.send( input: input, - forOperation: Operations.DeleteGithubAccount.id, + forOperation: Operations.ListGithubApps.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-accounts/{}", - parameters: [ - input.path.id - ] + template: "/v1/github-apps", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -17831,11 +19943,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListGithubApps.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Operations.ListGithubApps.Output.Ok.Body.JsonPayload.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.BadRequest.Body + let body: Operations.ListGithubApps.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17857,7 +19989,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.Unauthorized.Body + let body: Operations.ListGithubApps.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17879,7 +20011,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.NotFound.Body + let body: Operations.ListGithubApps.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17901,7 +20033,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.MethodNotAllowed.Body + let body: Operations.ListGithubApps.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17923,7 +20055,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.Conflict.Body + let body: Operations.ListGithubApps.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17945,7 +20077,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.ContentTooLarge.Body + let body: Operations.ListGithubApps.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17967,7 +20099,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.InternalServerError.Body + let body: Operations.ListGithubApps.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -17989,7 +20121,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubAccount.Output.ServiceUnavailable.Body + let body: Operations.ListGithubApps.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18021,24 +20153,22 @@ public struct Client: APIProtocol { } ) } - /// Replaces the bots that act as the machine account, giving them GH_TOKEN. A bot acts as at most one; 409 when a bot already acts as another. + /// Exchanges the code GitHub redirected back with for the App's keys, within an hour of starting. 400 for a stale or reused state. /// - /// - Remark: HTTP `PUT /v1/github-accounts/{id}/bots`. - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)`. - public func setGithubAccountBots(_ input: Operations.SetGithubAccountBots.Input) async throws -> Operations.SetGithubAccountBots.Output { + /// - Remark: HTTP `POST /v1/github-apps/complete`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)`. + public func completeGithubApp(_ input: Operations.CompleteGithubApp.Input) async throws -> Operations.CompleteGithubApp.Output { try await client.send( input: input, - forOperation: Operations.SetGithubAccountBots.id, + forOperation: Operations.CompleteGithubApp.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-accounts/{}/bots", - parameters: [ - input.path.id - ] + template: "/v1/github-apps/complete", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -18060,7 +20190,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.Ok.Body + let body: Operations.CompleteGithubApp.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18070,7 +20200,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GitHubAccount.self, + Components.Schemas.GitHubApp.self, from: responseBody, transforming: { value in .json(value) @@ -18082,7 +20212,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.BadRequest.Body + let body: Operations.CompleteGithubApp.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18104,7 +20234,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.Unauthorized.Body + let body: Operations.CompleteGithubApp.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18126,7 +20256,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.NotFound.Body + let body: Operations.CompleteGithubApp.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18148,7 +20278,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.MethodNotAllowed.Body + let body: Operations.CompleteGithubApp.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18170,7 +20300,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.Conflict.Body + let body: Operations.CompleteGithubApp.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18192,7 +20322,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.ContentTooLarge.Body + let body: Operations.CompleteGithubApp.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18214,7 +20344,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.InternalServerError.Body + let body: Operations.CompleteGithubApp.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18236,7 +20366,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountBots.Output.ServiceUnavailable.Body + let body: Operations.CompleteGithubApp.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18268,24 +20398,22 @@ public struct Client: APIProtocol { } ) } - /// Replaces the machine account's token. 400 when GitHub refuses it or it signs in as another user. + /// Starts creating a private GitHub App. The client posts `manifest` as a form field to `url`; GitHub then sends the owner to `{origin}/github-app/callback` with a code and state. /// - /// - Remark: HTTP `PUT /v1/github-accounts/{id}/token`. - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)`. - public func setGithubAccountToken(_ input: Operations.SetGithubAccountToken.Input) async throws -> Operations.SetGithubAccountToken.Output { + /// - Remark: HTTP `POST /v1/github-apps/manifest`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)`. + public func createGithubAppManifest(_ input: Operations.CreateGithubAppManifest.Input) async throws -> Operations.CreateGithubAppManifest.Output { try await client.send( input: input, - forOperation: Operations.SetGithubAccountToken.id, + forOperation: Operations.CreateGithubAppManifest.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-accounts/{}/token", - parameters: [ - input.path.id - ] + template: "/v1/github-apps/manifest", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -18307,7 +20435,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.Ok.Body + let body: Operations.CreateGithubAppManifest.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18317,7 +20445,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GitHubAccount.self, + Operations.CreateGithubAppManifest.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -18329,7 +20457,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.BadRequest.Body + let body: Operations.CreateGithubAppManifest.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18351,7 +20479,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.Unauthorized.Body + let body: Operations.CreateGithubAppManifest.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18373,7 +20501,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.NotFound.Body + let body: Operations.CreateGithubAppManifest.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18395,7 +20523,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.MethodNotAllowed.Body + let body: Operations.CreateGithubAppManifest.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18417,7 +20545,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.Conflict.Body + let body: Operations.CreateGithubAppManifest.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18439,7 +20567,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.ContentTooLarge.Body + let body: Operations.CreateGithubAppManifest.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18461,7 +20589,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.InternalServerError.Body + let body: Operations.CreateGithubAppManifest.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18483,7 +20611,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAccountToken.Output.ServiceUnavailable.Body + let body: Operations.CreateGithubAppManifest.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18515,35 +20643,44 @@ public struct Client: APIProtocol { } ) } - /// The account's GitHub Apps, each the GitHub identity its bots act through in one GitHub account's repositories. + /// Exchanges the code GitHub sent the owner back with for the owner's tokens, within ten minutes of starting. 400 for a stale or reused state or a refused sign-in. /// - /// - Remark: HTTP `GET /v1/github-apps`. - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)`. - public func listGithubApps(_ input: Operations.ListGithubApps.Input) async throws -> Operations.ListGithubApps.Output { + /// - Remark: HTTP `POST /v1/github-apps/sign-in/complete`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)`. + public func completeGithubAppSignIn(_ input: Operations.CompleteGithubAppSignIn.Input) async throws -> Operations.CompleteGithubAppSignIn.Output { try await client.send( input: input, - forOperation: Operations.ListGithubApps.id, + forOperation: Operations.CompleteGithubAppSignIn.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps", + template: "/v1/github-apps/sign-in/complete", parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.Ok.Body + let body: Operations.CompleteGithubAppSignIn.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18553,7 +20690,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.ListGithubApps.Output.Ok.Body.JsonPayload.self, + Components.Schemas.GitHubApp.self, from: responseBody, transforming: { value in .json(value) @@ -18565,7 +20702,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.BadRequest.Body + let body: Operations.CompleteGithubAppSignIn.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18587,7 +20724,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.Unauthorized.Body + let body: Operations.CompleteGithubAppSignIn.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18609,7 +20746,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.NotFound.Body + let body: Operations.CompleteGithubAppSignIn.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18631,7 +20768,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.MethodNotAllowed.Body + let body: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18653,7 +20790,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.Conflict.Body + let body: Operations.CompleteGithubAppSignIn.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18675,7 +20812,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.ContentTooLarge.Body + let body: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18697,7 +20834,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.InternalServerError.Body + let body: Operations.CompleteGithubAppSignIn.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18719,76 +20856,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGithubApps.Output.ServiceUnavailable.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas._Error.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .serviceUnavailable(.init(body: body)) - default: - return .undocumented( - statusCode: response.status.code, - .init( - headerFields: response.headerFields, - body: responseBody - ) - ) - } - } - ) - } - /// Exchanges the code GitHub redirected back with for the App's keys, within an hour of starting. 400 for a stale or reused state. - /// - /// - Remark: HTTP `POST /v1/github-apps/complete`. - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)`. - public func completeGithubApp(_ input: Operations.CompleteGithubApp.Input) async throws -> Operations.CompleteGithubApp.Output { - try await client.send( - input: input, - forOperation: Operations.CompleteGithubApp.id, - serializer: { input in - let path = try converter.renderedPath( - template: "/v1/github-apps/complete", - parameters: [] - ) - var request: HTTPTypes.HTTPRequest = .init( - soar_path: path, - method: .post - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) - }, - deserializer: { response, responseBody in - switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.Ok.Body + let body: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18798,7 +20866,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GitHubApp.self, + Components.Schemas._Error.self, from: responseBody, transforming: { value in .json(value) @@ -18807,10 +20875,52 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } + /// Forgets the App, signs the owner out of it, and takes GH_TOKEN from bots left without an installed App. The App stays on GitHub until the owner deletes it there. + /// + /// - Remark: HTTP `DELETE /v1/github-apps/{id}`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)`. + public func deleteGithubApp(_ input: Operations.DeleteGithubApp.Input) async throws -> Operations.DeleteGithubApp.Output { + try await client.send( + input: input, + forOperation: Operations.DeleteGithubApp.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/github-apps/{}", + parameters: [ + input.path.id + ] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.BadRequest.Body + let body: Operations.DeleteGithubApp.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18832,7 +20942,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.Unauthorized.Body + let body: Operations.DeleteGithubApp.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18854,7 +20964,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.NotFound.Body + let body: Operations.DeleteGithubApp.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18876,7 +20986,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.MethodNotAllowed.Body + let body: Operations.DeleteGithubApp.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18898,7 +21008,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.Conflict.Body + let body: Operations.DeleteGithubApp.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18920,7 +21030,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.ContentTooLarge.Body + let body: Operations.DeleteGithubApp.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18942,7 +21052,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.InternalServerError.Body + let body: Operations.DeleteGithubApp.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18964,7 +21074,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubApp.Output.ServiceUnavailable.Body + let body: Operations.DeleteGithubApp.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -18996,22 +21106,24 @@ public struct Client: APIProtocol { } ) } - /// Starts creating a private GitHub App. The client posts `manifest` as a form field to `url`; GitHub then sends the owner to `{origin}/github-app/callback` with a code and state. + /// Replaces the bots that act through the App. A bot uses at most one App per GitHub account; 409 when a bot already uses another App for this App's account. /// - /// - Remark: HTTP `POST /v1/github-apps/manifest`. - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)`. - public func createGithubAppManifest(_ input: Operations.CreateGithubAppManifest.Input) async throws -> Operations.CreateGithubAppManifest.Output { + /// - Remark: HTTP `PUT /v1/github-apps/{id}/bots`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)`. + public func setGithubAppBots(_ input: Operations.SetGithubAppBots.Input) async throws -> Operations.SetGithubAppBots.Output { try await client.send( input: input, - forOperation: Operations.CreateGithubAppManifest.id, + forOperation: Operations.SetGithubAppBots.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/manifest", - parameters: [] + template: "/v1/github-apps/{}/bots", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -19033,7 +21145,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.Ok.Body + let body: Operations.SetGithubAppBots.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19043,7 +21155,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.CreateGithubAppManifest.Output.Ok.Body.JsonPayload.self, + Components.Schemas.GitHubApp.self, from: responseBody, transforming: { value in .json(value) @@ -19055,7 +21167,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.BadRequest.Body + let body: Operations.SetGithubAppBots.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19077,7 +21189,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.Unauthorized.Body + let body: Operations.SetGithubAppBots.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19099,7 +21211,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.NotFound.Body + let body: Operations.SetGithubAppBots.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19121,7 +21233,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.MethodNotAllowed.Body + let body: Operations.SetGithubAppBots.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19143,7 +21255,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.Conflict.Body + let body: Operations.SetGithubAppBots.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19165,7 +21277,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.ContentTooLarge.Body + let body: Operations.SetGithubAppBots.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19187,7 +21299,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.InternalServerError.Body + let body: Operations.SetGithubAppBots.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19209,7 +21321,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGithubAppManifest.Output.ServiceUnavailable.Body + let body: Operations.SetGithubAppBots.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19241,22 +21353,24 @@ public struct Client: APIProtocol { } ) } - /// Exchanges the code GitHub sent the owner back with for the owner's tokens, within ten minutes of starting. 400 for a stale or reused state or a refused sign-in. + /// Stores a client secret generated in the App's GitHub settings, for an App created before Crumble kept it. /// - /// - Remark: HTTP `POST /v1/github-apps/sign-in/complete`. - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)`. - public func completeGithubAppSignIn(_ input: Operations.CompleteGithubAppSignIn.Input) async throws -> Operations.CompleteGithubAppSignIn.Output { + /// - Remark: HTTP `PUT /v1/github-apps/{id}/client-secret`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)`. + public func setGithubAppClientSecret(_ input: Operations.SetGithubAppClientSecret.Input) async throws -> Operations.SetGithubAppClientSecret.Output { try await client.send( input: input, - forOperation: Operations.CompleteGithubAppSignIn.id, + forOperation: Operations.SetGithubAppClientSecret.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/sign-in/complete", - parameters: [] + template: "/v1/github-apps/{}/client-secret", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .put ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -19278,7 +21392,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.Ok.Body + let body: Operations.SetGithubAppClientSecret.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19300,7 +21414,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.BadRequest.Body + let body: Operations.SetGithubAppClientSecret.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19322,7 +21436,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.Unauthorized.Body + let body: Operations.SetGithubAppClientSecret.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19344,7 +21458,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.NotFound.Body + let body: Operations.SetGithubAppClientSecret.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19366,7 +21480,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed.Body + let body: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19388,7 +21502,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.Conflict.Body + let body: Operations.SetGithubAppClientSecret.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19410,7 +21524,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge.Body + let body: Operations.SetGithubAppClientSecret.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19432,7 +21546,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.InternalServerError.Body + let body: Operations.SetGithubAppClientSecret.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19454,7 +21568,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable.Body + let body: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19486,24 +21600,24 @@ public struct Client: APIProtocol { } ) } - /// Forgets the App, signs the owner out of it, and takes GH_TOKEN from bots left without an installed App. The App stays on GitHub until the owner deletes it there. + /// Finds the App's installation on its account and gives its bots the GH_TOKEN credential. 409 until the owner installs the App. /// - /// - Remark: HTTP `DELETE /v1/github-apps/{id}`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)`. - public func deleteGithubApp(_ input: Operations.DeleteGithubApp.Input) async throws -> Operations.DeleteGithubApp.Output { + /// - Remark: HTTP `POST /v1/github-apps/{id}/connect`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)`. + public func connectGithubApp(_ input: Operations.ConnectGithubApp.Input) async throws -> Operations.ConnectGithubApp.Output { try await client.send( input: input, - forOperation: Operations.DeleteGithubApp.id, + forOperation: Operations.ConnectGithubApp.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/{}", + template: "/v1/github-apps/{}/connect", parameters: [ input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -19514,11 +21628,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ConnectGithubApp.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.GitHubApp.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.BadRequest.Body + let body: Operations.ConnectGithubApp.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19540,7 +21674,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.Unauthorized.Body + let body: Operations.ConnectGithubApp.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19562,7 +21696,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.NotFound.Body + let body: Operations.ConnectGithubApp.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19584,7 +21718,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.MethodNotAllowed.Body + let body: Operations.ConnectGithubApp.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19606,7 +21740,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.Conflict.Body + let body: Operations.ConnectGithubApp.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19628,7 +21762,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.ContentTooLarge.Body + let body: Operations.ConnectGithubApp.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19650,7 +21784,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.InternalServerError.Body + let body: Operations.ConnectGithubApp.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19672,7 +21806,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGithubApp.Output.ServiceUnavailable.Body + let body: Operations.ConnectGithubApp.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19704,24 +21838,24 @@ public struct Client: APIProtocol { } ) } - /// Replaces the bots that act through the App. A bot uses at most one App per GitHub account; 409 when a bot already uses another App for this App's account. + /// Starts signing the owner in to GitHub through the App, so its bots act as the owner. The client opens `url`; GitHub sends the owner to the App's callback URL, `{origin}/github-app/authorized`, or `{origin}/ui/github-app/authorized` for Apps created before the web UI moved to `/`, with a code and state. `origin` is no longer used. 409 without a client secret. /// - /// - Remark: HTTP `PUT /v1/github-apps/{id}/bots`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)`. - public func setGithubAppBots(_ input: Operations.SetGithubAppBots.Input) async throws -> Operations.SetGithubAppBots.Output { + /// - Remark: HTTP `POST /v1/github-apps/{id}/sign-in`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)`. + public func signInGithubApp(_ input: Operations.SignInGithubApp.Input) async throws -> Operations.SignInGithubApp.Output { try await client.send( input: input, - forOperation: Operations.SetGithubAppBots.id, + forOperation: Operations.SignInGithubApp.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/{}/bots", + template: "/v1/github-apps/{}/sign-in", parameters: [ input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -19743,7 +21877,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.Ok.Body + let body: Operations.SignInGithubApp.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19753,7 +21887,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GitHubApp.self, + Operations.SignInGithubApp.Output.Ok.Body.JsonPayload.self, from: responseBody, transforming: { value in .json(value) @@ -19765,7 +21899,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.BadRequest.Body + let body: Operations.SignInGithubApp.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19787,7 +21921,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.Unauthorized.Body + let body: Operations.SignInGithubApp.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19809,7 +21943,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.NotFound.Body + let body: Operations.SignInGithubApp.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19831,7 +21965,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.MethodNotAllowed.Body + let body: Operations.SignInGithubApp.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19853,7 +21987,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.Conflict.Body + let body: Operations.SignInGithubApp.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19875,7 +22009,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.ContentTooLarge.Body + let body: Operations.SignInGithubApp.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19897,7 +22031,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.InternalServerError.Body + let body: Operations.SignInGithubApp.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19919,7 +22053,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppBots.Output.ServiceUnavailable.Body + let body: Operations.SignInGithubApp.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -19951,46 +22085,37 @@ public struct Client: APIProtocol { } ) } - /// Stores a client secret generated in the App's GitHub settings, for an App created before Crumble kept it. + /// Revokes and forgets the owner's sign-in through the App; its bots act as the App again. /// - /// - Remark: HTTP `PUT /v1/github-apps/{id}/client-secret`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)`. - public func setGithubAppClientSecret(_ input: Operations.SetGithubAppClientSecret.Input) async throws -> Operations.SetGithubAppClientSecret.Output { + /// - Remark: HTTP `DELETE /v1/github-apps/{id}/user`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)`. + public func signOutGithubApp(_ input: Operations.SignOutGithubApp.Input) async throws -> Operations.SignOutGithubApp.Output { try await client.send( input: input, - forOperation: Operations.SetGithubAppClientSecret.id, + forOperation: Operations.SignOutGithubApp.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/{}/client-secret", + template: "/v1/github-apps/{}/user", parameters: [ input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put - ) - suppressMutabilityWarning(&request) - converter.setAcceptHeader( - in: &request.headerFields, - contentTypes: input.headers.accept - ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + method: .delete + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.Ok.Body + let body: Operations.SignOutGithubApp.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20012,7 +22137,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.BadRequest.Body + let body: Operations.SignOutGithubApp.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20034,7 +22159,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.Unauthorized.Body + let body: Operations.SignOutGithubApp.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20056,7 +22181,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.NotFound.Body + let body: Operations.SignOutGithubApp.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20078,7 +22203,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed.Body + let body: Operations.SignOutGithubApp.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20100,7 +22225,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.Conflict.Body + let body: Operations.SignOutGithubApp.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20122,7 +22247,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.ContentTooLarge.Body + let body: Operations.SignOutGithubApp.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20144,7 +22269,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.InternalServerError.Body + let body: Operations.SignOutGithubApp.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20166,7 +22291,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable.Body + let body: Operations.SignOutGithubApp.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20198,24 +22323,20 @@ public struct Client: APIProtocol { } ) } - /// Finds the App's installation on its account and gives its bots the GH_TOKEN credential. 409 until the owner installs the App. - /// - /// - Remark: HTTP `POST /v1/github-apps/{id}/connect`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)`. - public func connectGithubApp(_ input: Operations.ConnectGithubApp.Input) async throws -> Operations.ConnectGithubApp.Output { + /// - Remark: HTTP `GET /v1/group-chats`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)`. + public func listGroupChats(_ input: Operations.ListGroupChats.Input) async throws -> Operations.ListGroupChats.Output { try await client.send( input: input, - forOperation: Operations.ConnectGithubApp.id, + forOperation: Operations.ListGroupChats.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/{}/connect", - parameters: [ - input.path.id - ] + template: "/v1/group-chats", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -20228,7 +22349,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.Ok.Body + let body: Operations.ListGroupChats.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20238,7 +22359,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GitHubApp.self, + [Components.Schemas.GroupChat].self, from: responseBody, transforming: { value in .json(value) @@ -20250,7 +22371,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.BadRequest.Body + let body: Operations.ListGroupChats.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20272,7 +22393,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.Unauthorized.Body + let body: Operations.ListGroupChats.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20294,7 +22415,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.NotFound.Body + let body: Operations.ListGroupChats.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20316,7 +22437,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.MethodNotAllowed.Body + let body: Operations.ListGroupChats.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20338,7 +22459,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.Conflict.Body + let body: Operations.ListGroupChats.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20360,7 +22481,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.ContentTooLarge.Body + let body: Operations.ListGroupChats.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20382,7 +22503,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.InternalServerError.Body + let body: Operations.ListGroupChats.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20404,7 +22525,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ConnectGithubApp.Output.ServiceUnavailable.Body + let body: Operations.ListGroupChats.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20436,20 +22557,16 @@ public struct Client: APIProtocol { } ) } - /// Starts signing the owner in to GitHub through the App, so its bots act as the owner. The client opens `url`; GitHub sends the owner to the App's callback URL, `{origin}/github-app/authorized`, or `{origin}/ui/github-app/authorized` for Apps created before the web UI moved to `/`, with a code and state. `origin` is no longer used. 409 without a client secret. - /// - /// - Remark: HTTP `POST /v1/github-apps/{id}/sign-in`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)`. - public func signInGithubApp(_ input: Operations.SignInGithubApp.Input) async throws -> Operations.SignInGithubApp.Output { + /// - Remark: HTTP `POST /v1/group-chats`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)`. + public func createGroupChat(_ input: Operations.CreateGroupChat.Input) async throws -> Operations.CreateGroupChat.Output { try await client.send( input: input, - forOperation: Operations.SignInGithubApp.id, + forOperation: Operations.CreateGroupChat.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/{}/sign-in", - parameters: [ - input.path.id - ] + template: "/v1/group-chats", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, @@ -20473,9 +22590,9 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.Ok.Body + let body: Operations.CreateGroupChat.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20485,7 +22602,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Operations.SignInGithubApp.Output.Ok.Body.JsonPayload.self, + Components.Schemas.GroupChat.self, from: responseBody, transforming: { value in .json(value) @@ -20494,10 +22611,10 @@ public struct Client: APIProtocol { default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init(body: body)) + return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.BadRequest.Body + let body: Operations.CreateGroupChat.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20519,7 +22636,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.Unauthorized.Body + let body: Operations.CreateGroupChat.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20541,7 +22658,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.NotFound.Body + let body: Operations.CreateGroupChat.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20563,7 +22680,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.MethodNotAllowed.Body + let body: Operations.CreateGroupChat.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20585,7 +22702,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.Conflict.Body + let body: Operations.CreateGroupChat.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20607,7 +22724,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.ContentTooLarge.Body + let body: Operations.CreateGroupChat.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20629,7 +22746,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.InternalServerError.Body + let body: Operations.CreateGroupChat.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20651,7 +22768,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignInGithubApp.Output.ServiceUnavailable.Body + let body: Operations.CreateGroupChat.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20683,24 +22800,22 @@ public struct Client: APIProtocol { } ) } - /// Revokes and forgets the owner's sign-in through the App; its bots act as the App again. - /// - /// - Remark: HTTP `DELETE /v1/github-apps/{id}/user`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)`. - public func signOutGithubApp(_ input: Operations.SignOutGithubApp.Input) async throws -> Operations.SignOutGithubApp.Output { + /// - Remark: HTTP `GET /v1/group-chats/{id}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)`. + public func getGroupChat(_ input: Operations.GetGroupChat.Input) async throws -> Operations.GetGroupChat.Output { try await client.send( input: input, - forOperation: Operations.SignOutGithubApp.id, + forOperation: Operations.GetGroupChat.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/github-apps/{}/user", + template: "/v1/group-chats/{}", parameters: [ input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -20713,7 +22828,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.Ok.Body + let body: Operations.GetGroupChat.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20723,7 +22838,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GitHubApp.self, + Components.Schemas.GroupChat.self, from: responseBody, transforming: { value in .json(value) @@ -20735,7 +22850,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.BadRequest.Body + let body: Operations.GetGroupChat.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20757,7 +22872,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.Unauthorized.Body + let body: Operations.GetGroupChat.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20779,7 +22894,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.NotFound.Body + let body: Operations.GetGroupChat.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20801,7 +22916,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.MethodNotAllowed.Body + let body: Operations.GetGroupChat.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20823,7 +22938,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.Conflict.Body + let body: Operations.GetGroupChat.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20845,7 +22960,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.ContentTooLarge.Body + let body: Operations.GetGroupChat.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20867,7 +22982,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.InternalServerError.Body + let body: Operations.GetGroupChat.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20889,7 +23004,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.SignOutGithubApp.Output.ServiceUnavailable.Body + let body: Operations.GetGroupChat.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20921,33 +23036,44 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/group-chats`. - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)`. - public func listGroupChats(_ input: Operations.ListGroupChats.Input) async throws -> Operations.ListGroupChats.Output { + /// - Remark: HTTP `PATCH /v1/group-chats/{id}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)`. + public func updateGroupChat(_ input: Operations.UpdateGroupChat.Input) async throws -> Operations.UpdateGroupChat.Output { try await client.send( input: input, - forOperation: Operations.ListGroupChats.id, + forOperation: Operations.UpdateGroupChat.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats", - parameters: [] + template: "/v1/group-chats/{}", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .patch ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.Ok.Body + let body: Operations.UpdateGroupChat.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20957,7 +23083,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - [Components.Schemas.GroupChat].self, + Components.Schemas.GroupChat.self, from: responseBody, transforming: { value in .json(value) @@ -20969,7 +23095,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.BadRequest.Body + let body: Operations.UpdateGroupChat.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -20991,7 +23117,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.Unauthorized.Body + let body: Operations.UpdateGroupChat.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21013,7 +23139,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.NotFound.Body + let body: Operations.UpdateGroupChat.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21035,7 +23161,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.MethodNotAllowed.Body + let body: Operations.UpdateGroupChat.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21057,7 +23183,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.Conflict.Body + let body: Operations.UpdateGroupChat.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21079,7 +23205,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.ContentTooLarge.Body + let body: Operations.UpdateGroupChat.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21101,7 +23227,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.InternalServerError.Body + let body: Operations.UpdateGroupChat.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21123,7 +23249,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.ListGroupChats.Output.ServiceUnavailable.Body + let body: Operations.UpdateGroupChat.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21155,64 +23281,37 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `POST /v1/group-chats`. - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)`. - public func createGroupChat(_ input: Operations.CreateGroupChat.Input) async throws -> Operations.CreateGroupChat.Output { + /// - Remark: HTTP `DELETE /v1/group-chats/{id}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)`. + public func deleteGroupChat(_ input: Operations.DeleteGroupChat.Input) async throws -> Operations.DeleteGroupChat.Output { try await client.send( input: input, - forOperation: Operations.CreateGroupChat.id, + forOperation: Operations.DeleteGroupChat.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats", - parameters: [] + template: "/v1/group-chats/{}", + parameters: [ + input.path.id + ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .post + method: .delete ) suppressMutabilityWarning(&request) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { - case 201: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.Created.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "application/json" - ] - ) - switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GroupChat.self, - from: responseBody, - transforming: { value in - .json(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .created(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.BadRequest.Body + let body: Operations.DeleteGroupChat.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21234,7 +23333,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.Unauthorized.Body + let body: Operations.DeleteGroupChat.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21256,7 +23355,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.NotFound.Body + let body: Operations.DeleteGroupChat.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21278,7 +23377,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.MethodNotAllowed.Body + let body: Operations.DeleteGroupChat.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21300,7 +23399,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.Conflict.Body + let body: Operations.DeleteGroupChat.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21322,7 +23421,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.ContentTooLarge.Body + let body: Operations.DeleteGroupChat.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21344,7 +23443,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.InternalServerError.Body + let body: Operations.DeleteGroupChat.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21366,7 +23465,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.CreateGroupChat.Output.ServiceUnavailable.Body + let body: Operations.DeleteGroupChat.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21398,15 +23497,15 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/group-chats/{id}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)`. - public func getGroupChat(_ input: Operations.GetGroupChat.Input) async throws -> Operations.GetGroupChat.Output { + /// - Remark: HTTP `GET /v1/group-chats/{id}/chat`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)`. + public func getGroupChatSnapshot(_ input: Operations.GetGroupChatSnapshot.Input) async throws -> Operations.GetGroupChatSnapshot.Output { try await client.send( input: input, - forOperation: Operations.GetGroupChat.id, + forOperation: Operations.GetGroupChatSnapshot.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats/{}", + template: "/v1/group-chats/{}/chat", parameters: [ input.path.id ] @@ -21416,6 +23515,13 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -21426,7 +23532,7 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.Ok.Body + let body: Operations.GetGroupChatSnapshot.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21436,7 +23542,7 @@ public struct Client: APIProtocol { switch chosenContentType { case "application/json": body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GroupChat.self, + Components.Schemas.GroupChatSnapshot.self, from: responseBody, transforming: { value in .json(value) @@ -21448,7 +23554,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.BadRequest.Body + let body: Operations.GetGroupChatSnapshot.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21470,7 +23576,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.Unauthorized.Body + let body: Operations.GetGroupChatSnapshot.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21492,7 +23598,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.NotFound.Body + let body: Operations.GetGroupChatSnapshot.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21514,7 +23620,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.MethodNotAllowed.Body + let body: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21536,7 +23642,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.Conflict.Body + let body: Operations.GetGroupChatSnapshot.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21558,7 +23664,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.ContentTooLarge.Body + let body: Operations.GetGroupChatSnapshot.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21580,7 +23686,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.InternalServerError.Body + let body: Operations.GetGroupChatSnapshot.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21602,7 +23708,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChat.Output.ServiceUnavailable.Body + let body: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21634,57 +23740,57 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `PATCH /v1/group-chats/{id}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)`. - public func updateGroupChat(_ input: Operations.UpdateGroupChat.Input) async throws -> Operations.UpdateGroupChat.Output { + /// Server-sent events. Each snapshot event carries a GroupChatSnapshot JSON object in data, sent on connection and after every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay. + /// + /// - Remark: HTTP `GET /v1/group-chats/{id}/events`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)`. + public func streamGroupChatEvents(_ input: Operations.StreamGroupChatEvents.Input) async throws -> Operations.StreamGroupChatEvents.Output { try await client.send( input: input, - forOperation: Operations.UpdateGroupChat.id, + forOperation: Operations.StreamGroupChatEvents.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats/{}", + template: "/v1/group-chats/{}/events", parameters: [ input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .patch + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - let body: OpenAPIRuntime.HTTPBody? - switch input.body { - case let .json(value): - body = try converter.setRequiredRequestBodyAsJSON( - value, - headerFields: &request.headerFields, - contentType: "application/json; charset=utf-8" - ) - } - return (request, body) + return (request, nil) }, deserializer: { response, responseBody in switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.Ok.Body + let body: Operations.StreamGroupChatEvents.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "text/event-stream" ] ) switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GroupChat.self, + case "text/event-stream": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, from: responseBody, transforming: { value in - .json(value) + .textEventStream(value) } ) default: @@ -21693,7 +23799,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.BadRequest.Body + let body: Operations.StreamGroupChatEvents.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21715,7 +23821,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.Unauthorized.Body + let body: Operations.StreamGroupChatEvents.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21737,7 +23843,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.NotFound.Body + let body: Operations.StreamGroupChatEvents.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21759,7 +23865,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.MethodNotAllowed.Body + let body: Operations.StreamGroupChatEvents.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21781,7 +23887,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.Conflict.Body + let body: Operations.StreamGroupChatEvents.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21803,7 +23909,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.ContentTooLarge.Body + let body: Operations.StreamGroupChatEvents.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21825,7 +23931,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.InternalServerError.Body + let body: Operations.StreamGroupChatEvents.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21847,7 +23953,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.UpdateGroupChat.Output.ServiceUnavailable.Body + let body: Operations.StreamGroupChatEvents.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21879,24 +23985,38 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `DELETE /v1/group-chats/{id}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)`. - public func deleteGroupChat(_ input: Operations.DeleteGroupChat.Input) async throws -> Operations.DeleteGroupChat.Output { + /// - Remark: HTTP `GET /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)`. + public func listGroupFiles(_ input: Operations.ListGroupFiles.Input) async throws -> Operations.ListGroupFiles.Output { try await client.send( input: input, - forOperation: Operations.DeleteGroupChat.id, + forOperation: Operations.ListGroupFiles.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats/{}", + template: "/v1/group-chats/{}/files", parameters: [ input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .delete + method: .get ) suppressMutabilityWarning(&request) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "before", + value: input.query.before + ) + try converter.setQueryItemAsURI( + in: &request, + style: .form, + explode: true, + name: "limit", + value: input.query.limit + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -21905,11 +24025,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.ListGroupFiles.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + [Components.Schemas.LibraryFile].self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.BadRequest.Body + let body: Operations.ListGroupFiles.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21931,7 +24071,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.Unauthorized.Body + let body: Operations.ListGroupFiles.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21953,7 +24093,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.NotFound.Body + let body: Operations.ListGroupFiles.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21975,7 +24115,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.MethodNotAllowed.Body + let body: Operations.ListGroupFiles.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -21997,7 +24137,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.Conflict.Body + let body: Operations.ListGroupFiles.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22019,7 +24159,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.ContentTooLarge.Body + let body: Operations.ListGroupFiles.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22041,7 +24181,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.InternalServerError.Body + let body: Operations.ListGroupFiles.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22063,7 +24203,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.DeleteGroupChat.Output.ServiceUnavailable.Body + let body: Operations.ListGroupFiles.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22095,67 +24235,71 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/group-chats/{id}/attachments/{entryId}/{index}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)`. - public func getGroupAttachment(_ input: Operations.GetGroupAttachment.Input) async throws -> Operations.GetGroupAttachment.Output { + /// - Remark: HTTP `POST /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)`. + public func uploadGroupFile(_ input: Operations.UploadGroupFile.Input) async throws -> Operations.UploadGroupFile.Output { try await client.send( input: input, - forOperation: Operations.GetGroupAttachment.id, + forOperation: Operations.UploadGroupFile.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats/{}/attachments/{}/{}", + template: "/v1/group-chats/{}/files", parameters: [ - input.path.id, - input.path.entryId, - input.path.index + input.path.id ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .post ) suppressMutabilityWarning(&request) + try converter.setHeaderFieldAsURI( + in: &request.headerFields, + name: "x-file-name", + value: input.headers.xFileName + ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept ) - return (request, nil) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .any(value): + body = try converter.setRequiredRequestBodyAsBinary( + value, + headerFields: &request.headerFields, + contentType: "*/*" + ) + } + return (request, body) }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let headers: Operations.GetGroupAttachment.Output.Ok.Headers = .init(cacheControl: try converter.getOptionalHeaderFieldAsURI( - in: response.headerFields, - name: "Cache-Control", - as: Swift.String.self - )) + case 201: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.Ok.Body + let body: Operations.UploadGroupFile.Output.Created.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "*/*" + "application/json" ] ) switch chosenContentType { - case "*/*": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.UploadFile.self, from: responseBody, transforming: { value in - .any(value) + .json(value) } ) default: preconditionFailure("bestContentType chose an invalid content type.") } - return .ok(.init( - headers: headers, - body: body - )) + return .created(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.BadRequest.Body + let body: Operations.UploadGroupFile.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22177,7 +24321,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.Unauthorized.Body + let body: Operations.UploadGroupFile.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22199,7 +24343,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.NotFound.Body + let body: Operations.UploadGroupFile.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22221,7 +24365,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.MethodNotAllowed.Body + let body: Operations.UploadGroupFile.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22243,7 +24387,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.Conflict.Body + let body: Operations.UploadGroupFile.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22265,7 +24409,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.ContentTooLarge.Body + let body: Operations.UploadGroupFile.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22287,7 +24431,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.InternalServerError.Body + let body: Operations.UploadGroupFile.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22309,7 +24453,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupAttachment.Output.ServiceUnavailable.Body + let body: Operations.UploadGroupFile.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22341,17 +24485,18 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `GET /v1/group-chats/{id}/chat`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)`. - public func getGroupChatSnapshot(_ input: Operations.GetGroupChatSnapshot.Input) async throws -> Operations.GetGroupChatSnapshot.Output { + /// - Remark: HTTP `GET /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)`. + public func getGroupFile(_ input: Operations.GetGroupFile.Input) async throws -> Operations.GetGroupFile.Output { try await client.send( input: input, - forOperation: Operations.GetGroupChatSnapshot.id, + forOperation: Operations.GetGroupFile.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats/{}/chat", + template: "/v1/group-chats/{}/files/{}", parameters: [ - input.path.id + input.path.id, + input.path.fileId ] ) var request: HTTPTypes.HTTPRequest = .init( @@ -22359,13 +24504,6 @@ public struct Client: APIProtocol { method: .get ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "limit", - value: input.query.limit - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -22376,20 +24514,20 @@ public struct Client: APIProtocol { switch response.status.code { case 200: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.Ok.Body + let body: Operations.GetGroupFile.Output.Ok.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ - "application/json" + "application/octet-stream" ] ) switch chosenContentType { - case "application/json": - body = try await converter.getResponseBodyAsJSON( - Components.Schemas.GroupChatSnapshot.self, + case "application/octet-stream": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, from: responseBody, transforming: { value in - .json(value) + .binary(value) } ) default: @@ -22398,7 +24536,7 @@ public struct Client: APIProtocol { return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.BadRequest.Body + let body: Operations.GetGroupFile.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22420,7 +24558,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.Unauthorized.Body + let body: Operations.GetGroupFile.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22442,7 +24580,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.NotFound.Body + let body: Operations.GetGroupFile.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22464,7 +24602,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed.Body + let body: Operations.GetGroupFile.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22486,7 +24624,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.Conflict.Body + let body: Operations.GetGroupFile.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22508,7 +24646,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.ContentTooLarge.Body + let body: Operations.GetGroupFile.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22530,7 +24668,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.InternalServerError.Body + let body: Operations.GetGroupFile.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22552,7 +24690,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable.Body + let body: Operations.GetGroupFile.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22584,33 +24722,25 @@ public struct Client: APIProtocol { } ) } - /// Server-sent events. Each snapshot event carries a GroupChatSnapshot JSON object in data, sent on connection and after every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay. - /// - /// - Remark: HTTP `GET /v1/group-chats/{id}/events`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)`. - public func streamGroupChatEvents(_ input: Operations.StreamGroupChatEvents.Input) async throws -> Operations.StreamGroupChatEvents.Output { + /// - Remark: HTTP `DELETE /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)`. + public func deleteGroupFile(_ input: Operations.DeleteGroupFile.Input) async throws -> Operations.DeleteGroupFile.Output { try await client.send( input: input, - forOperation: Operations.StreamGroupChatEvents.id, + forOperation: Operations.DeleteGroupFile.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/group-chats/{}/events", + template: "/v1/group-chats/{}/files/{}", parameters: [ - input.path.id + input.path.id, + input.path.fileId ] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .get + method: .delete ) suppressMutabilityWarning(&request) - try converter.setQueryItemAsURI( - in: &request, - style: .form, - explode: true, - name: "limit", - value: input.query.limit - ) converter.setAcceptHeader( in: &request.headerFields, contentTypes: input.headers.accept @@ -22619,31 +24749,11 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 200: - let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.Ok.Body - let chosenContentType = try converter.bestContentType( - received: contentType, - options: [ - "text/event-stream" - ] - ) - switch chosenContentType { - case "text/event-stream": - body = try converter.getResponseBodyAsBinary( - OpenAPIRuntime.HTTPBody.self, - from: responseBody, - transforming: { value in - .textEventStream(value) - } - ) - default: - preconditionFailure("bestContentType chose an invalid content type.") - } - return .ok(.init(body: body)) + case 204: + return .noContent(.init()) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.BadRequest.Body + let body: Operations.DeleteGroupFile.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22665,7 +24775,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.Unauthorized.Body + let body: Operations.DeleteGroupFile.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22687,7 +24797,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.NotFound.Body + let body: Operations.DeleteGroupFile.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22709,7 +24819,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.MethodNotAllowed.Body + let body: Operations.DeleteGroupFile.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22731,7 +24841,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.Conflict.Body + let body: Operations.DeleteGroupFile.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22753,7 +24863,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.ContentTooLarge.Body + let body: Operations.DeleteGroupFile.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22775,7 +24885,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.InternalServerError.Body + let body: Operations.DeleteGroupFile.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -22797,7 +24907,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.StreamGroupChatEvents.Output.ServiceUnavailable.Body + let body: Operations.DeleteGroupFile.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31189,22 +33299,20 @@ public struct Client: APIProtocol { } ) } - /// - Remark: HTTP `PUT /v1/push/devices/{installationId}/presence`. - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)`. - public func putPushPresence(_ input: Operations.PutPushPresence.Input) async throws -> Operations.PutPushPresence.Output { + /// - Remark: HTTP `POST /v1/reasoning/preview`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)`. + public func previewReasoning(_ input: Operations.PreviewReasoning.Input) async throws -> Operations.PreviewReasoning.Output { try await client.send( input: input, - forOperation: Operations.PutPushPresence.id, + forOperation: Operations.PreviewReasoning.id, serializer: { input in let path = try converter.renderedPath( - template: "/v1/push/devices/{}/presence", - parameters: [ - input.path.installationId - ] + template: "/v1/reasoning/preview", + parameters: [] ) var request: HTTPTypes.HTTPRequest = .init( soar_path: path, - method: .put + method: .post ) suppressMutabilityWarning(&request) converter.setAcceptHeader( @@ -31224,11 +33332,31 @@ public struct Client: APIProtocol { }, deserializer: { response, responseBody in switch response.status.code { - case 204: - return .noContent(.init()) + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewReasoning.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.ReasoningPreview.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) case 400: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.BadRequest.Body + let body: Operations.PreviewReasoning.Output.BadRequest.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31250,7 +33378,7 @@ public struct Client: APIProtocol { return .badRequest(.init(body: body)) case 401: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.Unauthorized.Body + let body: Operations.PreviewReasoning.Output.Unauthorized.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31272,7 +33400,7 @@ public struct Client: APIProtocol { return .unauthorized(.init(body: body)) case 404: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.NotFound.Body + let body: Operations.PreviewReasoning.Output.NotFound.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31294,7 +33422,7 @@ public struct Client: APIProtocol { return .notFound(.init(body: body)) case 405: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.MethodNotAllowed.Body + let body: Operations.PreviewReasoning.Output.MethodNotAllowed.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31316,7 +33444,7 @@ public struct Client: APIProtocol { return .methodNotAllowed(.init(body: body)) case 409: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.Conflict.Body + let body: Operations.PreviewReasoning.Output.Conflict.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31338,7 +33466,7 @@ public struct Client: APIProtocol { return .conflict(.init(body: body)) case 413: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.ContentTooLarge.Body + let body: Operations.PreviewReasoning.Output.ContentTooLarge.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31360,7 +33488,7 @@ public struct Client: APIProtocol { return .contentTooLarge(.init(body: body)) case 500: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.InternalServerError.Body + let body: Operations.PreviewReasoning.Output.InternalServerError.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31382,7 +33510,7 @@ public struct Client: APIProtocol { return .internalServerError(.init(body: body)) case 503: let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) - let body: Operations.PutPushPresence.Output.ServiceUnavailable.Body + let body: Operations.PreviewReasoning.Output.ServiceUnavailable.Body let chosenContentType = try converter.bestContentType( received: contentType, options: [ @@ -31920,6 +34048,249 @@ public struct Client: APIProtocol { } ) } + /// - Remark: HTTP `POST /v1/schedules/preview`. + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)`. + public func previewSchedule(_ input: Operations.PreviewSchedule.Input) async throws -> Operations.PreviewSchedule.Output { + try await client.send( + input: input, + forOperation: Operations.PreviewSchedule.id, + serializer: { input in + let path = try converter.renderedPath( + template: "/v1/schedules/preview", + parameters: [] + ) + var request: HTTPTypes.HTTPRequest = .init( + soar_path: path, + method: .post + ) + suppressMutabilityWarning(&request) + converter.setAcceptHeader( + in: &request.headerFields, + contentTypes: input.headers.accept + ) + let body: OpenAPIRuntime.HTTPBody? + switch input.body { + case let .json(value): + body = try converter.setRequiredRequestBodyAsJSON( + value, + headerFields: &request.headerFields, + contentType: "application/json; charset=utf-8" + ) + } + return (request, body) + }, + deserializer: { response, responseBody in + switch response.status.code { + case 200: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.Ok.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas.SchedulePreview.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .ok(.init(body: body)) + case 400: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.BadRequest.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .badRequest(.init(body: body)) + case 401: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.Unauthorized.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .unauthorized(.init(body: body)) + case 404: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.NotFound.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .notFound(.init(body: body)) + case 405: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.MethodNotAllowed.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .methodNotAllowed(.init(body: body)) + case 409: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.Conflict.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .conflict(.init(body: body)) + case 413: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.ContentTooLarge.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "text/plain" + ] + ) + switch chosenContentType { + case "text/plain": + body = try converter.getResponseBodyAsBinary( + OpenAPIRuntime.HTTPBody.self, + from: responseBody, + transforming: { value in + .plainText(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .contentTooLarge(.init(body: body)) + case 500: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.InternalServerError.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .internalServerError(.init(body: body)) + case 503: + let contentType = converter.extractContentTypeIfPresent(in: response.headerFields) + let body: Operations.PreviewSchedule.Output.ServiceUnavailable.Body + let chosenContentType = try converter.bestContentType( + received: contentType, + options: [ + "application/json" + ] + ) + switch chosenContentType { + case "application/json": + body = try await converter.getResponseBodyAsJSON( + Components.Schemas._Error.self, + from: responseBody, + transforming: { value in + .json(value) + } + ) + default: + preconditionFailure("bestContentType chose an invalid content type.") + } + return .serviceUnavailable(.init(body: body)) + default: + return .undocumented( + statusCode: response.status.code, + .init( + headerFields: response.headerFields, + body: responseBody + ) + ) + } + } + ) + } /// - Remark: HTTP `PATCH /v1/schedules/{id}`. /// - Remark: Generated from `#/paths//v1/schedules/{id}/patch(updateSchedule)`. public func updateSchedule(_ input: Operations.UpdateSchedule.Input) async throws -> Operations.UpdateSchedule.Output { diff --git a/apfelkern/Sources/apfelkern/Generated/Types+Components+Schemas.swift b/apfelkern/Sources/apfelkern/Generated/Types+Components+Schemas.swift index 1697b6a..1746626 100644 --- a/apfelkern/Sources/apfelkern/Generated/Types+Components+Schemas.swift +++ b/apfelkern/Sources/apfelkern/Generated/Types+Components+Schemas.swift @@ -513,46 +513,6 @@ extension Components { try self.value2.encode(to: encoder) } } - /// - Remark: Generated from `#/components/schemas/AttachmentInfo`. - public struct AttachmentInfo: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/AttachmentInfo/kind`. - @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { - case image = "image" - case text = "text" - } - /// - Remark: Generated from `#/components/schemas/AttachmentInfo/kind`. - public var kind: Components.Schemas.AttachmentInfo.KindPayload - /// - Remark: Generated from `#/components/schemas/AttachmentInfo/mimeType`. - public var mimeType: Swift.String - /// - Remark: Generated from `#/components/schemas/AttachmentInfo/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/AttachmentInfo/size`. - public var size: Swift.Double - /// Creates a new `AttachmentInfo`. - /// - /// - Parameters: - /// - kind: - /// - mimeType: - /// - name: - /// - size: - public init( - kind: Components.Schemas.AttachmentInfo.KindPayload, - mimeType: Swift.String, - name: Swift.String, - size: Swift.Double - ) { - self.kind = kind - self.mimeType = mimeType - self.name = name - self.size = size - } - public enum CodingKeys: String, CodingKey { - case kind - case mimeType - case name - case size - } - } /// Open Bot Avatar v1 geometry in a 0 0 100 100 viewBox, body color and eye color. /// /// - Remark: Generated from `#/components/schemas/BotAvatarDefinition`. @@ -1630,6 +1590,19 @@ extension Components { /// /// - Remark: Generated from `#/components/schemas/ChatSnapshot/value2/usage`. public var usage: OpenAPIRuntime.OpenAPIValueContainer? + /// - Remark: Generated from `#/components/schemas/ChatSnapshot/value2/working`. + @frozen public enum WorkingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case idle = "idle" + case thinking = "thinking" + case writing = "writing" + case searching = "searching" + case remembering = "remembering" + case tinkering = "tinkering" + case struggling = "struggling" + case failed = "failed" + } + /// - Remark: Generated from `#/components/schemas/ChatSnapshot/value2/working`. + public var working: Components.Schemas.ChatSnapshot.Value2Payload.WorkingPayload /// Creates a new `Value2Payload`. /// /// - Parameters: @@ -1642,6 +1615,7 @@ extension Components { /// - status: /// - updatedAt: /// - usage: Pi Durable usage document. + /// - working: public init( agentId: Swift.String, conversation: Components.Schemas.Conversation, @@ -1651,7 +1625,8 @@ extension Components { partial: Swift.String, status: Components.Schemas.ChatSnapshot.Value2Payload.StatusPayload, updatedAt: Swift.Double, - usage: OpenAPIRuntime.OpenAPIValueContainer? = nil + usage: OpenAPIRuntime.OpenAPIValueContainer? = nil, + working: Components.Schemas.ChatSnapshot.Value2Payload.WorkingPayload ) { self.agentId = agentId self.conversation = conversation @@ -1662,6 +1637,7 @@ extension Components { self.status = status self.updatedAt = updatedAt self.usage = usage + self.working = working } public enum CodingKeys: String, CodingKey { case agentId @@ -1673,6 +1649,7 @@ extension Components { case status case updatedAt case usage + case working } } /// - Remark: Generated from `#/components/schemas/ChatSnapshot/value2`. @@ -1698,6 +1675,35 @@ extension Components { try self.value2.encode(to: encoder) } } + /// - Remark: Generated from `#/components/schemas/Citation`. + public struct Citation: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/Citation/href`. + public var href: Swift.String + /// - Remark: Generated from `#/components/schemas/Citation/site`. + public var site: Swift.String + /// - Remark: Generated from `#/components/schemas/Citation/title`. + public var title: Swift.String + /// Creates a new `Citation`. + /// + /// - Parameters: + /// - href: + /// - site: + /// - title: + public init( + href: Swift.String, + site: Swift.String, + title: Swift.String + ) { + self.href = href + self.site = site + self.title = title + } + public enum CodingKeys: String, CodingKey { + case href + case site + case title + } + } /// - Remark: Generated from `#/components/schemas/CodingJob`. public struct CodingJob: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/CodingJob/conversationId`. @@ -3027,102 +3033,8 @@ extension Components { public var live: OpenAPIRuntime.OpenAPIValueContainer? /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload`. public struct MessagesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/AttachmentsPayload`. - public struct AttachmentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/AttachmentsPayload/kind`. - @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { - case image = "image" - case text = "text" - } - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/AttachmentsPayload/kind`. - public var kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload.KindPayload - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/AttachmentsPayload/mimeType`. - public var mimeType: Swift.String - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/AttachmentsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/AttachmentsPayload/size`. - public var size: Swift.Double - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `AttachmentsPayloadPayload`. - /// - /// - Parameters: - /// - kind: - /// - mimeType: - /// - name: - /// - size: - /// - additionalProperties: A container of undocumented properties. - public init( - kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload.KindPayload, - mimeType: Swift.String, - name: Swift.String, - size: Swift.Double, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.kind = kind - self.mimeType = mimeType - self.name = name - self.size = size - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case kind - case mimeType - case name - case size - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.kind = try container.decode( - Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload.KindPayload.self, - forKey: .kind - ) - self.mimeType = try container.decode( - Swift.String.self, - forKey: .mimeType - ) - self.name = try container.decode( - Swift.String.self, - forKey: .name - ) - self.size = try container.decode( - Swift.Double.self, - forKey: .size - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "kind", - "mimeType", - "name", - "size" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - self.kind, - forKey: .kind - ) - try container.encode( - self.mimeType, - forKey: .mimeType - ) - try container.encode( - self.name, - forKey: .name - ) - try container.encode( - self.size, - forKey: .size - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/attachments`. - public typealias AttachmentsPayload = [Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/attachments`. - public var attachments: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayload? /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/blocks`. - public var blocks: OpenAPIRuntime.OpenAPIValueContainer? + public var blocks: [Components.Schemas.TranscriptBlock]? /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/call`. public struct CallPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/call/callId`. @@ -3328,6 +3240,195 @@ extension Components { public var content: Swift.String /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/entryId`. public var entryId: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload`. + public struct FilesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value1/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value1/mimeType`. + public var mimeType: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value1/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value1/size`. + public var size: Swift.Double + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: + /// - mimeType: + /// - name: + /// - size: + /// - additionalProperties: A container of undocumented properties. + public init( + id: Swift.String, + mimeType: Swift.String, + name: Swift.String, + size: Swift.Double, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.id = id + self.mimeType = mimeType + self.name = name + self.size = size + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case id + case mimeType + case name + case size + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.id = try container.decode( + Swift.String.self, + forKey: .id + ) + self.mimeType = try container.decode( + Swift.String.self, + forKey: .mimeType + ) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.size = try container.decode( + Swift.Double.self, + forKey: .size + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "id", + "mimeType", + "name", + "size" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.id, + forKey: .id + ) + try container.encode( + self.mimeType, + forKey: .mimeType + ) + try container.encode( + self.name, + forKey: .name + ) + try container.encode( + self.size, + forKey: .size + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value1`. + public var value1: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value1Payload? + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value2/deleted`. + public var deleted: Swift.Bool + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value2/id`. + public var id: Swift.String + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - deleted: + /// - id: + /// - additionalProperties: A container of undocumented properties. + public init( + deleted: Swift.Bool, + id: Swift.String, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.deleted = deleted + self.id = id + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case deleted + case id + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.deleted = try container.decode( + Swift.Bool.self, + forKey: .deleted + ) + self.id = try container.decode( + Swift.String.self, + forKey: .id + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "deleted", + "id" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.deleted, + forKey: .deleted + ) + try container.encode( + self.id, + forKey: .id + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/FilesPayload/value2`. + public var value2: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value2Payload? + /// Creates a new `FilesPayloadPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value1Payload? = nil, + value2: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value2Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/files`. + public typealias FilesPayload = [Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/files`. + public var files: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayload? /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/heldAction`. public struct HeldActionPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/heldAction/id`. @@ -3595,56 +3696,324 @@ extension Components { } /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/origin`. public var origin: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.OriginPayload? + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/presentation`. + public var presentation: Components.Schemas.MessagePresentation? /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/replyPreview`. public var replyPreview: Swift.String? - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/replyTo`. - public var replyTo: Swift.String? - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/requestId`. - public var requestId: Swift.String? - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/role`. - public var role: Swift.String - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/SourcesPayload`. - public struct SourcesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/SourcesPayload/title`. - public var title: Swift.String - /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/SourcesPayload/url`. - public var url: Swift.String - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `SourcesPayloadPayload`. - /// - /// - Parameters: - /// - title: - /// - url: - /// - additionalProperties: A container of undocumented properties. - public init( - title: Swift.String, - url: Swift.String, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.title = title - self.url = url - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case title - case url - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.title = try container.decode( - Swift.String.self, - forKey: .title - ) - self.url = try container.decode( - Swift.String.self, - forKey: .url - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "title", - "url" - ]) - } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload`. + public struct ReplyReferencesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/eventId`. + public var eventId: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface`. + @frozen public enum SurfacePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1/kind`. + public var kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - kind: + /// - additionalProperties: A container of undocumented properties. + public init( + kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.kind = kind + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case kind + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.kind = try container.decode( + Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload.self, + forKey: .kind + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "kind" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.kind, + forKey: .kind + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1`. + case case1(Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload) + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case toolCard = "tool-card" + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2/kind`. + public var kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2/toolCallId`. + public var toolCallId: Swift.String + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - kind: + /// - toolCallId: + /// - additionalProperties: A container of undocumented properties. + public init( + kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload, + toolCallId: Swift.String, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.kind = kind + self.toolCallId = toolCallId + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case kind + case toolCallId + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.kind = try container.decode( + Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload.self, + forKey: .kind + ) + self.toolCallId = try container.decode( + Swift.String.self, + forKey: .toolCallId + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "kind", + "toolCallId" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.kind, + forKey: .kind + ) + try container.encode( + self.toolCallId, + forKey: .toolCallId + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2`. + case case2(Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload) + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3/actionId`. + public var actionId: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case heldAction = "held-action" + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3/kind`. + public var kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - actionId: + /// - kind: + /// - additionalProperties: A container of undocumented properties. + public init( + actionId: Swift.String, + kind: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.actionId = actionId + self.kind = kind + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case actionId + case kind + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.actionId = try container.decode( + Swift.String.self, + forKey: .actionId + ) + self.kind = try container.decode( + Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload.self, + forKey: .kind + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "actionId", + "kind" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.actionId, + forKey: .actionId + ) + try container.encode( + self.kind, + forKey: .kind + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3`. + case case3(Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + case let .case3(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface`. + public var surface: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `ReplyReferencesPayloadPayload`. + /// + /// - Parameters: + /// - eventId: + /// - surface: + /// - additionalProperties: A container of undocumented properties. + public init( + eventId: Swift.String, + surface: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.eventId = eventId + self.surface = surface + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case eventId + case surface + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.eventId = try container.decode( + Swift.String.self, + forKey: .eventId + ) + self.surface = try container.decode( + Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.self, + forKey: .surface + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "eventId", + "surface" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.eventId, + forKey: .eventId + ) + try container.encode( + self.surface, + forKey: .surface + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/replyReferences`. + public typealias ReplyReferencesPayload = [Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/replyReferences`. + public var replyReferences: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayload + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/replyTo`. + public var replyTo: Swift.String? + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/requestId`. + public var requestId: Swift.String? + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/role`. + public var role: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/SourcesPayload`. + public struct SourcesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/SourcesPayload/title`. + public var title: Swift.String + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/MessagesPayload/SourcesPayload/url`. + public var url: Swift.String + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `SourcesPayloadPayload`. + /// + /// - Parameters: + /// - title: + /// - url: + /// - additionalProperties: A container of undocumented properties. + public init( + title: Swift.String, + url: Swift.String, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.title = title + self.url = url + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case title + case url + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.title = try container.decode( + Swift.String.self, + forKey: .title + ) + self.url = try container.decode( + Swift.String.self, + forKey: .url + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "title", + "url" + ]) + } public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode( @@ -3677,19 +4046,21 @@ extension Components { /// Creates a new `MessagesPayloadPayload`. /// /// - Parameters: - /// - attachments: /// - blocks: /// - call: /// - communication: /// - content: /// - entryId: + /// - files: /// - heldAction: /// - id: /// - isError: /// - jobQuestion: /// - kind: /// - origin: + /// - presentation: /// - replyPreview: + /// - replyReferences: /// - replyTo: /// - requestId: /// - role: @@ -3701,19 +4072,21 @@ extension Components { /// - toolName: /// - additionalProperties: A container of undocumented properties. public init( - attachments: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayload? = nil, - blocks: OpenAPIRuntime.OpenAPIValueContainer? = nil, + blocks: [Components.Schemas.TranscriptBlock]? = nil, call: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.CallPayload? = nil, communication: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.CommunicationPayload? = nil, content: Swift.String, entryId: Swift.String, + files: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayload? = nil, heldAction: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.HeldActionPayload? = nil, id: Swift.String, isError: Swift.Bool? = nil, jobQuestion: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.JobQuestionPayload? = nil, kind: Swift.String? = nil, origin: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.OriginPayload? = nil, + presentation: Components.Schemas.MessagePresentation? = nil, replyPreview: Swift.String? = nil, + replyReferences: Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayload, replyTo: Swift.String? = nil, requestId: Swift.String? = nil, role: Swift.String, @@ -3725,19 +4098,21 @@ extension Components { toolName: Swift.String? = nil, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.attachments = attachments self.blocks = blocks self.call = call self.communication = communication self.content = content self.entryId = entryId + self.files = files self.heldAction = heldAction self.id = id self.isError = isError self.jobQuestion = jobQuestion self.kind = kind self.origin = origin + self.presentation = presentation self.replyPreview = replyPreview + self.replyReferences = replyReferences self.replyTo = replyTo self.requestId = requestId self.role = role @@ -3750,19 +4125,21 @@ extension Components { self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case attachments case blocks case call case communication case content case entryId + case files case heldAction case id case isError case jobQuestion case kind case origin + case presentation case replyPreview + case replyReferences case replyTo case requestId case role @@ -3775,12 +4152,8 @@ extension Components { } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.attachments = try container.decodeIfPresent( - Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.AttachmentsPayload.self, - forKey: .attachments - ) self.blocks = try container.decodeIfPresent( - OpenAPIRuntime.OpenAPIValueContainer.self, + [Components.Schemas.TranscriptBlock].self, forKey: .blocks ) self.call = try container.decodeIfPresent( @@ -3799,6 +4172,10 @@ extension Components { Swift.String.self, forKey: .entryId ) + self.files = try container.decodeIfPresent( + Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.FilesPayload.self, + forKey: .files + ) self.heldAction = try container.decodeIfPresent( Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.HeldActionPayload.self, forKey: .heldAction @@ -3823,10 +4200,18 @@ extension Components { Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.OriginPayload.self, forKey: .origin ) + self.presentation = try container.decodeIfPresent( + Components.Schemas.MessagePresentation.self, + forKey: .presentation + ) self.replyPreview = try container.decodeIfPresent( Swift.String.self, forKey: .replyPreview ) + self.replyReferences = try container.decode( + Components.Schemas.EventChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayload.self, + forKey: .replyReferences + ) self.replyTo = try container.decodeIfPresent( Swift.String.self, forKey: .replyTo @@ -3864,19 +4249,21 @@ extension Components { forKey: .toolName ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "attachments", "blocks", "call", "communication", "content", "entryId", + "files", "heldAction", "id", "isError", "jobQuestion", "kind", "origin", + "presentation", "replyPreview", + "replyReferences", "replyTo", "requestId", "role", @@ -3890,10 +4277,6 @@ extension Components { } public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.attachments, - forKey: .attachments - ) try container.encodeIfPresent( self.blocks, forKey: .blocks @@ -3914,6 +4297,10 @@ extension Components { self.entryId, forKey: .entryId ) + try container.encodeIfPresent( + self.files, + forKey: .files + ) try container.encodeIfPresent( self.heldAction, forKey: .heldAction @@ -3938,10 +4325,18 @@ extension Components { self.origin, forKey: .origin ) + try container.encodeIfPresent( + self.presentation, + forKey: .presentation + ) try container.encodeIfPresent( self.replyPreview, forKey: .replyPreview ) + try container.encode( + self.replyReferences, + forKey: .replyReferences + ) try container.encodeIfPresent( self.replyTo, forKey: .replyTo @@ -4001,6 +4396,19 @@ extension Components { public var updatedAt: Swift.Double /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/usage`. public var usage: OpenAPIRuntime.OpenAPIValueContainer? + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/working`. + @frozen public enum WorkingPayload: String, Codable, Hashable, Sendable, CaseIterable { + case idle = "idle" + case thinking = "thinking" + case writing = "writing" + case searching = "searching" + case remembering = "remembering" + case tinkering = "tinkering" + case struggling = "struggling" + case failed = "failed" + } + /// - Remark: Generated from `#/components/schemas/EventChatSnapshot/working`. + public var working: Components.Schemas.EventChatSnapshot.WorkingPayload /// A container of undocumented properties. public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer /// Creates a new `EventChatSnapshot`. @@ -4018,6 +4426,7 @@ extension Components { /// - status: /// - updatedAt: /// - usage: + /// - working: /// - additionalProperties: A container of undocumented properties. public init( agentId: Swift.String, @@ -4032,6 +4441,7 @@ extension Components { status: Components.Schemas.EventChatSnapshot.StatusPayload, updatedAt: Swift.Double, usage: OpenAPIRuntime.OpenAPIValueContainer? = nil, + working: Components.Schemas.EventChatSnapshot.WorkingPayload, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { self.agentId = agentId @@ -4046,6 +4456,7 @@ extension Components { self.status = status self.updatedAt = updatedAt self.usage = usage + self.working = working self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { @@ -4061,6 +4472,7 @@ extension Components { case status case updatedAt case usage + case working } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) @@ -4112,6 +4524,10 @@ extension Components { OpenAPIRuntime.OpenAPIValueContainer.self, forKey: .usage ) + self.working = try container.decode( + Components.Schemas.EventChatSnapshot.WorkingPayload.self, + forKey: .working + ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ "agentId", "conversation", @@ -4124,7 +4540,8 @@ extension Components { "partial", "status", "updatedAt", - "usage" + "usage", + "working" ]) } public func encode(to encoder: any Swift.Encoder) throws { @@ -4177,6 +4594,10 @@ extension Components { self.usage, forKey: .usage ) + try container.encode( + self.working, + forKey: .working + ) try encoder.encodeAdditionalProperties(additionalProperties) } } @@ -4514,102 +4935,8 @@ extension Components { public var hasMore: Swift.Bool /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload`. public struct MessagesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/AttachmentsPayload`. - public struct AttachmentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/AttachmentsPayload/kind`. - @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { - case image = "image" - case text = "text" - } - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/AttachmentsPayload/kind`. - public var kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload.KindPayload - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/AttachmentsPayload/mimeType`. - public var mimeType: Swift.String - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/AttachmentsPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/AttachmentsPayload/size`. - public var size: Swift.Double - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `AttachmentsPayloadPayload`. - /// - /// - Parameters: - /// - kind: - /// - mimeType: - /// - name: - /// - size: - /// - additionalProperties: A container of undocumented properties. - public init( - kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload.KindPayload, - mimeType: Swift.String, - name: Swift.String, - size: Swift.Double, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.kind = kind - self.mimeType = mimeType - self.name = name - self.size = size - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case kind - case mimeType - case name - case size - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.kind = try container.decode( - Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload.KindPayload.self, - forKey: .kind - ) - self.mimeType = try container.decode( - Swift.String.self, - forKey: .mimeType - ) - self.name = try container.decode( - Swift.String.self, - forKey: .name - ) - self.size = try container.decode( - Swift.Double.self, - forKey: .size - ) - additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "kind", - "mimeType", - "name", - "size" - ]) - } - public func encode(to encoder: any Swift.Encoder) throws { - var container = encoder.container(keyedBy: CodingKeys.self) - try container.encode( - self.kind, - forKey: .kind - ) - try container.encode( - self.mimeType, - forKey: .mimeType - ) - try container.encode( - self.name, - forKey: .name - ) - try container.encode( - self.size, - forKey: .size - ) - try encoder.encodeAdditionalProperties(additionalProperties) - } - } - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/attachments`. - public typealias AttachmentsPayload = [Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayloadPayload] - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/attachments`. - public var attachments: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayload? /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/blocks`. - public var blocks: OpenAPIRuntime.OpenAPIValueContainer? + public var blocks: [Components.Schemas.TranscriptBlock]? /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/call`. public struct CallPayload: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/call/callId`. @@ -4815,39 +5142,228 @@ extension Components { public var content: Swift.String /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/entryId`. public var entryId: Swift.String - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/heldAction`. - public struct HeldActionPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/heldAction/id`. - public var id: Swift.String - /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/heldAction/job`. - public var job: Swift.String - /// A container of undocumented properties. - public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer - /// Creates a new `HeldActionPayload`. - /// - /// - Parameters: - /// - id: - /// - job: - /// - additionalProperties: A container of undocumented properties. - public init( - id: Swift.String, - job: Swift.String, - additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() - ) { - self.id = id - self.job = job - self.additionalProperties = additionalProperties - } - public enum CodingKeys: String, CodingKey { - case id - case job - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.id = try container.decode( - Swift.String.self, - forKey: .id - ) + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload`. + public struct FilesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value1/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value1/mimeType`. + public var mimeType: Swift.String + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value1/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value1/size`. + public var size: Swift.Double + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: + /// - mimeType: + /// - name: + /// - size: + /// - additionalProperties: A container of undocumented properties. + public init( + id: Swift.String, + mimeType: Swift.String, + name: Swift.String, + size: Swift.Double, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.id = id + self.mimeType = mimeType + self.name = name + self.size = size + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case id + case mimeType + case name + case size + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.id = try container.decode( + Swift.String.self, + forKey: .id + ) + self.mimeType = try container.decode( + Swift.String.self, + forKey: .mimeType + ) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + self.size = try container.decode( + Swift.Double.self, + forKey: .size + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "id", + "mimeType", + "name", + "size" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.id, + forKey: .id + ) + try container.encode( + self.mimeType, + forKey: .mimeType + ) + try container.encode( + self.name, + forKey: .name + ) + try container.encode( + self.size, + forKey: .size + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value1`. + public var value1: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value1Payload? + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value2/deleted`. + public var deleted: Swift.Bool + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value2/id`. + public var id: Swift.String + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - deleted: + /// - id: + /// - additionalProperties: A container of undocumented properties. + public init( + deleted: Swift.Bool, + id: Swift.String, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.deleted = deleted + self.id = id + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case deleted + case id + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.deleted = try container.decode( + Swift.Bool.self, + forKey: .deleted + ) + self.id = try container.decode( + Swift.String.self, + forKey: .id + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "deleted", + "id" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.deleted, + forKey: .deleted + ) + try container.encode( + self.id, + forKey: .id + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/FilesPayload/value2`. + public var value2: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value2Payload? + /// Creates a new `FilesPayloadPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value1Payload? = nil, + value2: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload.Value2Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/files`. + public typealias FilesPayload = [Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/files`. + public var files: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayload? + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/heldAction`. + public struct HeldActionPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/heldAction/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/heldAction/job`. + public var job: Swift.String + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `HeldActionPayload`. + /// + /// - Parameters: + /// - id: + /// - job: + /// - additionalProperties: A container of undocumented properties. + public init( + id: Swift.String, + job: Swift.String, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.id = id + self.job = job + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case id + case job + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.id = try container.decode( + Swift.String.self, + forKey: .id + ) self.job = try container.decode( Swift.String.self, forKey: .job @@ -5082,8 +5598,276 @@ extension Components { } /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/origin`. public var origin: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.OriginPayload? + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/presentation`. + public var presentation: Components.Schemas.MessagePresentation? /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/replyPreview`. public var replyPreview: Swift.String? + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload`. + public struct ReplyReferencesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/eventId`. + public var eventId: Swift.String + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface`. + @frozen public enum SurfacePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1/kind`. + public var kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - kind: + /// - additionalProperties: A container of undocumented properties. + public init( + kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.kind = kind + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case kind + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.kind = try container.decode( + Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload.self, + forKey: .kind + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "kind" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.kind, + forKey: .kind + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case1`. + case case1(Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload) + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case toolCard = "tool-card" + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2/kind`. + public var kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2/toolCallId`. + public var toolCallId: Swift.String + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - kind: + /// - toolCallId: + /// - additionalProperties: A container of undocumented properties. + public init( + kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload, + toolCallId: Swift.String, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.kind = kind + self.toolCallId = toolCallId + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case kind + case toolCallId + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.kind = try container.decode( + Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload.self, + forKey: .kind + ) + self.toolCallId = try container.decode( + Swift.String.self, + forKey: .toolCallId + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "kind", + "toolCallId" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.kind, + forKey: .kind + ) + try container.encode( + self.toolCallId, + forKey: .toolCallId + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case2`. + case case2(Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload) + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3/actionId`. + public var actionId: Swift.String + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case heldAction = "held-action" + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3/kind`. + public var kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - actionId: + /// - kind: + /// - additionalProperties: A container of undocumented properties. + public init( + actionId: Swift.String, + kind: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.actionId = actionId + self.kind = kind + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case actionId + case kind + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.actionId = try container.decode( + Swift.String.self, + forKey: .actionId + ) + self.kind = try container.decode( + Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload.self, + forKey: .kind + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "actionId", + "kind" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.actionId, + forKey: .actionId + ) + try container.encode( + self.kind, + forKey: .kind + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface/case3`. + case case3(Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + case let .case3(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/ReplyReferencesPayload/surface`. + public var surface: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload + /// A container of undocumented properties. + public var additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer + /// Creates a new `ReplyReferencesPayloadPayload`. + /// + /// - Parameters: + /// - eventId: + /// - surface: + /// - additionalProperties: A container of undocumented properties. + public init( + eventId: Swift.String, + surface: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload, + additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() + ) { + self.eventId = eventId + self.surface = surface + self.additionalProperties = additionalProperties + } + public enum CodingKeys: String, CodingKey { + case eventId + case surface + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.eventId = try container.decode( + Swift.String.self, + forKey: .eventId + ) + self.surface = try container.decode( + Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload.SurfacePayload.self, + forKey: .surface + ) + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ + "eventId", + "surface" + ]) + } + public func encode(to encoder: any Swift.Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode( + self.eventId, + forKey: .eventId + ) + try container.encode( + self.surface, + forKey: .surface + ) + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/replyReferences`. + public typealias ReplyReferencesPayload = [Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/replyReferences`. + public var replyReferences: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayload /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/replyTo`. public var replyTo: Swift.String? /// - Remark: Generated from `#/components/schemas/EventGroupChatSnapshot/MessagesPayload/requestId`. @@ -5164,19 +5948,21 @@ extension Components { /// Creates a new `MessagesPayloadPayload`. /// /// - Parameters: - /// - attachments: /// - blocks: /// - call: /// - communication: /// - content: /// - entryId: + /// - files: /// - heldAction: /// - id: /// - isError: /// - jobQuestion: /// - kind: /// - origin: + /// - presentation: /// - replyPreview: + /// - replyReferences: /// - replyTo: /// - requestId: /// - role: @@ -5188,19 +5974,21 @@ extension Components { /// - toolName: /// - additionalProperties: A container of undocumented properties. public init( - attachments: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayload? = nil, - blocks: OpenAPIRuntime.OpenAPIValueContainer? = nil, + blocks: [Components.Schemas.TranscriptBlock]? = nil, call: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.CallPayload? = nil, communication: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.CommunicationPayload? = nil, content: Swift.String, entryId: Swift.String, + files: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayload? = nil, heldAction: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.HeldActionPayload? = nil, id: Swift.String, isError: Swift.Bool? = nil, jobQuestion: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.JobQuestionPayload? = nil, kind: Swift.String? = nil, origin: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.OriginPayload? = nil, + presentation: Components.Schemas.MessagePresentation? = nil, replyPreview: Swift.String? = nil, + replyReferences: Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayload, replyTo: Swift.String? = nil, requestId: Swift.String? = nil, role: Swift.String, @@ -5212,19 +6000,21 @@ extension Components { toolName: Swift.String? = nil, additionalProperties: OpenAPIRuntime.OpenAPIObjectContainer = .init() ) { - self.attachments = attachments self.blocks = blocks self.call = call self.communication = communication self.content = content self.entryId = entryId + self.files = files self.heldAction = heldAction self.id = id self.isError = isError self.jobQuestion = jobQuestion self.kind = kind self.origin = origin + self.presentation = presentation self.replyPreview = replyPreview + self.replyReferences = replyReferences self.replyTo = replyTo self.requestId = requestId self.role = role @@ -5237,19 +6027,21 @@ extension Components { self.additionalProperties = additionalProperties } public enum CodingKeys: String, CodingKey { - case attachments case blocks case call case communication case content case entryId + case files case heldAction case id case isError case jobQuestion case kind case origin + case presentation case replyPreview + case replyReferences case replyTo case requestId case role @@ -5262,12 +6054,8 @@ extension Components { } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.attachments = try container.decodeIfPresent( - Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.AttachmentsPayload.self, - forKey: .attachments - ) self.blocks = try container.decodeIfPresent( - OpenAPIRuntime.OpenAPIValueContainer.self, + [Components.Schemas.TranscriptBlock].self, forKey: .blocks ) self.call = try container.decodeIfPresent( @@ -5286,6 +6074,10 @@ extension Components { Swift.String.self, forKey: .entryId ) + self.files = try container.decodeIfPresent( + Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.FilesPayload.self, + forKey: .files + ) self.heldAction = try container.decodeIfPresent( Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.HeldActionPayload.self, forKey: .heldAction @@ -5310,10 +6102,18 @@ extension Components { Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.OriginPayload.self, forKey: .origin ) + self.presentation = try container.decodeIfPresent( + Components.Schemas.MessagePresentation.self, + forKey: .presentation + ) self.replyPreview = try container.decodeIfPresent( Swift.String.self, forKey: .replyPreview ) + self.replyReferences = try container.decode( + Components.Schemas.EventGroupChatSnapshot.MessagesPayloadPayload.ReplyReferencesPayload.self, + forKey: .replyReferences + ) self.replyTo = try container.decodeIfPresent( Swift.String.self, forKey: .replyTo @@ -5351,19 +6151,21 @@ extension Components { forKey: .toolName ) additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: [ - "attachments", "blocks", "call", "communication", "content", "entryId", + "files", "heldAction", "id", "isError", "jobQuestion", "kind", "origin", + "presentation", "replyPreview", + "replyReferences", "replyTo", "requestId", "role", @@ -5377,10 +6179,6 @@ extension Components { } public func encode(to encoder: any Swift.Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent( - self.attachments, - forKey: .attachments - ) try container.encodeIfPresent( self.blocks, forKey: .blocks @@ -5401,6 +6199,10 @@ extension Components { self.entryId, forKey: .entryId ) + try container.encodeIfPresent( + self.files, + forKey: .files + ) try container.encodeIfPresent( self.heldAction, forKey: .heldAction @@ -5425,10 +6227,18 @@ extension Components { self.origin, forKey: .origin ) + try container.encodeIfPresent( + self.presentation, + forKey: .presentation + ) try container.encodeIfPresent( self.replyPreview, forKey: .replyPreview ) + try container.encode( + self.replyReferences, + forKey: .replyReferences + ) try container.encodeIfPresent( self.replyTo, forKey: .replyTo @@ -6209,22 +7019,238 @@ extension Components { case id } } - /// The model that judges now: a classifier, or a small chat model when no key reaches one. Null when no model is available; then only commit points are held. - /// - /// - Remark: Generated from `#/components/schemas/JudgeChoice`. - public struct JudgeChoice: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/JudgeChoice/kind`. - @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { - case classifier = "classifier" - case chat = "chat" + /// - Remark: Generated from `#/components/schemas/JobHistoryItem`. + @frozen public enum JobHistoryItem: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JobHistoryItem/JobReplyItem`. + case reply(Components.Schemas.JobReplyItem) + /// - Remark: Generated from `#/components/schemas/JobHistoryItem/JobStepItem`. + case step(Components.Schemas.JobStepItem) + /// - Remark: Generated from `#/components/schemas/JobHistoryItem/JobTaskItem`. + case task(Components.Schemas.JobTaskItem) + public enum CodingKeys: String, CodingKey { + case kind } - /// - Remark: Generated from `#/components/schemas/JudgeChoice/kind`. - public var kind: Components.Schemas.JudgeChoice.KindPayload - /// - Remark: Generated from `#/components/schemas/JudgeChoice/model`. - public var model: Swift.String - /// - Remark: Generated from `#/components/schemas/JudgeChoice/name`. - public var name: Swift.String - /// - Remark: Generated from `#/components/schemas/JudgeChoice/provider`. + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let discriminator = try container.decode( + Swift.String.self, + forKey: .kind + ) + switch discriminator { + case "reply": + self = .reply(try .init(from: decoder)) + case "step": + self = .step(try .init(from: decoder)) + case "task": + self = .task(try .init(from: decoder)) + default: + throw Swift.DecodingError.unknownOneOfDiscriminator( + discriminatorKey: CodingKeys.kind, + discriminatorValue: discriminator, + codingPath: decoder.codingPath + ) + } + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .reply(value): + try value.encode(to: encoder) + case let .step(value): + try value.encode(to: encoder) + case let .task(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/JobHistoryPage`. + public struct JobHistoryPage: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JobHistoryPage/value1`. + public var value1: Components.Schemas.TranscriptPage + /// - Remark: Generated from `#/components/schemas/JobHistoryPage/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JobHistoryPage/value2/items`. + public var items: [Components.Schemas.JobHistoryItem] + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - items: + public init(items: [Components.Schemas.JobHistoryItem]) { + self.items = items + } + public enum CodingKeys: String, CodingKey { + case items + } + } + /// - Remark: Generated from `#/components/schemas/JobHistoryPage/value2`. + public var value2: Components.Schemas.JobHistoryPage.Value2Payload + /// Creates a new `JobHistoryPage`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.TranscriptPage, + value2: Components.Schemas.JobHistoryPage.Value2Payload + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + self.value1 = try .init(from: decoder) + self.value2 = try .init(from: decoder) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1.encode(to: encoder) + try self.value2.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/JobReplyItem`. + public struct JobReplyItem: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JobReplyItem/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/JobReplyItem/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case reply = "reply" + } + /// - Remark: Generated from `#/components/schemas/JobReplyItem/kind`. + public var kind: Components.Schemas.JobReplyItem.KindPayload + /// - Remark: Generated from `#/components/schemas/JobReplyItem/text`. + public var text: Swift.String + /// Creates a new `JobReplyItem`. + /// + /// - Parameters: + /// - id: + /// - kind: + /// - text: + public init( + id: Swift.String, + kind: Components.Schemas.JobReplyItem.KindPayload, + text: Swift.String + ) { + self.id = id + self.kind = kind + self.text = text + } + public enum CodingKeys: String, CodingKey { + case id + case kind + case text + } + } + /// - Remark: Generated from `#/components/schemas/JobStepItem`. + public struct JobStepItem: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JobStepItem/icon`. + @frozen public enum IconPayload: String, Codable, Hashable, Sendable, CaseIterable { + case terminal = "terminal" + case file = "file" + case pencil = "pencil" + case pointer = "pointer" + case tool = "tool" + } + /// - Remark: Generated from `#/components/schemas/JobStepItem/icon`. + public var icon: Components.Schemas.JobStepItem.IconPayload + /// - Remark: Generated from `#/components/schemas/JobStepItem/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/JobStepItem/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case step = "step" + } + /// - Remark: Generated from `#/components/schemas/JobStepItem/kind`. + public var kind: Components.Schemas.JobStepItem.KindPayload + /// - Remark: Generated from `#/components/schemas/JobStepItem/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/JobStepItem/result`. + public var result: Components.Schemas.TranscriptMessage? + /// - Remark: Generated from `#/components/schemas/JobStepItem/subject`. + public var subject: Swift.String? + /// - Remark: Generated from `#/components/schemas/JobStepItem/tool`. + public var tool: Swift.String + /// Creates a new `JobStepItem`. + /// + /// - Parameters: + /// - icon: + /// - id: + /// - kind: + /// - label: + /// - result: + /// - subject: + /// - tool: + public init( + icon: Components.Schemas.JobStepItem.IconPayload, + id: Swift.String, + kind: Components.Schemas.JobStepItem.KindPayload, + label: Swift.String, + result: Components.Schemas.TranscriptMessage? = nil, + subject: Swift.String? = nil, + tool: Swift.String + ) { + self.icon = icon + self.id = id + self.kind = kind + self.label = label + self.result = result + self.subject = subject + self.tool = tool + } + public enum CodingKeys: String, CodingKey { + case icon + case id + case kind + case label + case result + case subject + case tool + } + } + /// - Remark: Generated from `#/components/schemas/JobTaskItem`. + public struct JobTaskItem: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JobTaskItem/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/JobTaskItem/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case task = "task" + } + /// - Remark: Generated from `#/components/schemas/JobTaskItem/kind`. + public var kind: Components.Schemas.JobTaskItem.KindPayload + /// - Remark: Generated from `#/components/schemas/JobTaskItem/text`. + public var text: Swift.String + /// Creates a new `JobTaskItem`. + /// + /// - Parameters: + /// - id: + /// - kind: + /// - text: + public init( + id: Swift.String, + kind: Components.Schemas.JobTaskItem.KindPayload, + text: Swift.String + ) { + self.id = id + self.kind = kind + self.text = text + } + public enum CodingKeys: String, CodingKey { + case id + case kind + case text + } + } + /// The model that judges now: a classifier, or a small chat model when no key reaches one. Null when no model is available; then only commit points are held. + /// + /// - Remark: Generated from `#/components/schemas/JudgeChoice`. + public struct JudgeChoice: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/JudgeChoice/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case classifier = "classifier" + case chat = "chat" + } + /// - Remark: Generated from `#/components/schemas/JudgeChoice/kind`. + public var kind: Components.Schemas.JudgeChoice.KindPayload + /// - Remark: Generated from `#/components/schemas/JudgeChoice/model`. + public var model: Swift.String + /// - Remark: Generated from `#/components/schemas/JudgeChoice/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/JudgeChoice/provider`. public var provider: Swift.String /// Creates a new `JudgeChoice`. /// @@ -6626,6 +7652,47 @@ extension Components { case _type = "type" } } + /// - Remark: Generated from `#/components/schemas/LibraryFile`. + public struct LibraryFile: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/LibraryFile/createdAt`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/components/schemas/LibraryFile/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/LibraryFile/mimeType`. + public var mimeType: Swift.String + /// - Remark: Generated from `#/components/schemas/LibraryFile/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/LibraryFile/size`. + public var size: Swift.Int + /// Creates a new `LibraryFile`. + /// + /// - Parameters: + /// - createdAt: + /// - id: + /// - mimeType: + /// - name: + /// - size: + public init( + createdAt: Swift.String, + id: Swift.String, + mimeType: Swift.String, + name: Swift.String, + size: Swift.Int + ) { + self.createdAt = createdAt + self.id = id + self.mimeType = mimeType + self.name = name + self.size = size + } + public enum CodingKeys: String, CodingKey { + case createdAt + case id + case mimeType + case name + case size + } + } /// - Remark: Generated from `#/components/schemas/ListedSkill`. @frozen public enum ListedSkill: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/ListedSkill/case1`. @@ -7395,6 +8462,29 @@ extension Components { case via } } + /// - Remark: Generated from `#/components/schemas/MessagePresentation`. + public struct MessagePresentation: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/MessagePresentation/citations`. + public var citations: [Components.Schemas.Citation] + /// - Remark: Generated from `#/components/schemas/MessagePresentation/text`. + public var text: Swift.String + /// Creates a new `MessagePresentation`. + /// + /// - Parameters: + /// - citations: + /// - text: + public init( + citations: [Components.Schemas.Citation], + text: Swift.String + ) { + self.citations = citations + self.text = text + } + public enum CodingKeys: String, CodingKey { + case citations + case text + } + } /// - Remark: Generated from `#/components/schemas/Model`. public struct Model: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/Model/contextWindow`. @@ -8399,6 +9489,72 @@ extension Components { case transports } } + /// - Remark: Generated from `#/components/schemas/ReasoningOption`. + public struct ReasoningOption: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ReasoningOption/label`. + public var label: Swift.String + /// - Remark: Generated from `#/components/schemas/ReasoningOption/value`. + @frozen public enum ValuePayload: String, Codable, Hashable, Sendable, CaseIterable { + case off = "off" + case minimal = "minimal" + case low = "low" + case medium = "medium" + case high = "high" + case xhigh = "xhigh" + case max = "max" + } + /// - Remark: Generated from `#/components/schemas/ReasoningOption/value`. + public var value: Components.Schemas.ReasoningOption.ValuePayload + /// Creates a new `ReasoningOption`. + /// + /// - Parameters: + /// - label: + /// - value: + public init( + label: Swift.String, + value: Components.Schemas.ReasoningOption.ValuePayload + ) { + self.label = label + self.value = value + } + public enum CodingKeys: String, CodingKey { + case label + case value + } + } + /// - Remark: Generated from `#/components/schemas/ReasoningPreview`. + public struct ReasoningPreview: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/ReasoningPreview/effectiveLevel`. + @frozen public enum EffectiveLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case off = "off" + case minimal = "minimal" + case low = "low" + case medium = "medium" + case high = "high" + case xhigh = "xhigh" + case max = "max" + } + /// - Remark: Generated from `#/components/schemas/ReasoningPreview/effectiveLevel`. + public var effectiveLevel: Components.Schemas.ReasoningPreview.EffectiveLevelPayload + /// - Remark: Generated from `#/components/schemas/ReasoningPreview/options`. + public var options: [Components.Schemas.ReasoningOption] + /// Creates a new `ReasoningPreview`. + /// + /// - Parameters: + /// - effectiveLevel: + /// - options: + public init( + effectiveLevel: Components.Schemas.ReasoningPreview.EffectiveLevelPayload, + options: [Components.Schemas.ReasoningOption] + ) { + self.effectiveLevel = effectiveLevel + self.options = options + } + public enum CodingKeys: String, CodingKey { + case effectiveLevel + case options + } + } /// - Remark: Generated from `#/components/schemas/ReplyEvent`. public struct ReplyEvent: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/ReplyEvent/agentId`. @@ -8561,6 +9717,8 @@ extension Components { public var createdByAgentId: Swift.String? /// - Remark: Generated from `#/components/schemas/Schedule/cron`. public var cron: Swift.String? + /// - Remark: Generated from `#/components/schemas/Schedule/description`. + public var description: Swift.String /// - Remark: Generated from `#/components/schemas/Schedule/enabled`. public var enabled: Swift.Bool /// The event source whose events start this automation; set instead of `cron` and `runAt`. @@ -8580,6 +9738,8 @@ extension Components { public var name: Swift.String /// - Remark: Generated from `#/components/schemas/Schedule/nextRunAt`. public var nextRunAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/Schedule/nextRunLabel`. + public var nextRunLabel: Swift.String /// - Remark: Generated from `#/components/schemas/Schedule/notify`. public var notify: Swift.Bool /// - Remark: Generated from `#/components/schemas/Schedule/prompt`. @@ -8590,6 +9750,8 @@ extension Components { public var timeoutSeconds: Swift.Int /// - Remark: Generated from `#/components/schemas/Schedule/timezone`. public var timezone: Swift.String + /// - Remark: Generated from `#/components/schemas/Schedule/timing`. + public var timing: Swift.String /// Creates a new `Schedule`. /// /// - Parameters: @@ -8598,51 +9760,60 @@ extension Components { /// - createdAt: /// - createdByAgentId: /// - cron: + /// - description: /// - enabled: /// - eventSourceId: The event source whose events start this automation; set instead of `cron` and `runAt`. /// - id: /// - kind: /// - name: /// - nextRunAt: + /// - nextRunLabel: /// - notify: /// - prompt: /// - runAt: /// - timeoutSeconds: /// - timezone: + /// - timing: public init( agentId: Swift.String, command: Swift.String? = nil, createdAt: Swift.String, createdByAgentId: Swift.String? = nil, cron: Swift.String? = nil, + description: Swift.String, enabled: Swift.Bool, eventSourceId: Swift.String? = nil, id: Swift.String, kind: Components.Schemas.Schedule.KindPayload, name: Swift.String, nextRunAt: Swift.String? = nil, + nextRunLabel: Swift.String, notify: Swift.Bool, prompt: Swift.String, runAt: Swift.String? = nil, timeoutSeconds: Swift.Int, - timezone: Swift.String + timezone: Swift.String, + timing: Swift.String ) { self.agentId = agentId self.command = command self.createdAt = createdAt self.createdByAgentId = createdByAgentId self.cron = cron + self.description = description self.enabled = enabled self.eventSourceId = eventSourceId self.id = id self.kind = kind self.name = name self.nextRunAt = nextRunAt + self.nextRunLabel = nextRunLabel self.notify = notify self.prompt = prompt self.runAt = runAt self.timeoutSeconds = timeoutSeconds self.timezone = timezone + self.timing = timing } public enum CodingKeys: String, CodingKey { case agentId @@ -8650,17 +9821,55 @@ extension Components { case createdAt case createdByAgentId case cron + case description case enabled case eventSourceId case id case kind case name case nextRunAt + case nextRunLabel case notify case prompt case runAt case timeoutSeconds case timezone + case timing + } + } + /// - Remark: Generated from `#/components/schemas/SchedulePreview`. + public struct SchedulePreview: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/SchedulePreview/description`. + public var description: Swift.String + /// - Remark: Generated from `#/components/schemas/SchedulePreview/isProblem`. + public var isProblem: Swift.Bool + /// - Remark: Generated from `#/components/schemas/SchedulePreview/nextRunAt`. + public var nextRunAt: Swift.String? + /// - Remark: Generated from `#/components/schemas/SchedulePreview/text`. + public var text: Swift.String + /// Creates a new `SchedulePreview`. + /// + /// - Parameters: + /// - description: + /// - isProblem: + /// - nextRunAt: + /// - text: + public init( + description: Swift.String, + isProblem: Swift.Bool, + nextRunAt: Swift.String? = nil, + text: Swift.String + ) { + self.description = description + self.isProblem = isProblem + self.nextRunAt = nextRunAt + self.text = text + } + public enum CodingKeys: String, CodingKey { + case description + case isProblem + case nextRunAt + case text } } /// - Remark: Generated from `#/components/schemas/ScheduleRun`. @@ -9538,14 +10747,86 @@ extension Components { case reply } } + /// - Remark: Generated from `#/components/schemas/TranscriptBlock`. + @frozen public enum TranscriptBlock: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptBlock/TranscriptImageBlock`. + case image(Components.Schemas.TranscriptImageBlock) + /// - Remark: Generated from `#/components/schemas/TranscriptBlock/TranscriptTextBlock`. + case text(Components.Schemas.TranscriptTextBlock) + /// - Remark: Generated from `#/components/schemas/TranscriptBlock/TranscriptThinkingBlock`. + case thinking(Components.Schemas.TranscriptThinkingBlock) + /// - Remark: Generated from `#/components/schemas/TranscriptBlock/TranscriptToolCallBlock`. + case toolCall(Components.Schemas.TranscriptToolCallBlock) + public enum CodingKeys: String, CodingKey { + case _type = "type" + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + let discriminator = try container.decode( + Swift.String.self, + forKey: ._type + ) + switch discriminator { + case "image": + self = .image(try .init(from: decoder)) + case "text": + self = .text(try .init(from: decoder)) + case "thinking": + self = .thinking(try .init(from: decoder)) + case "toolCall": + self = .toolCall(try .init(from: decoder)) + default: + throw Swift.DecodingError.unknownOneOfDiscriminator( + discriminatorKey: CodingKeys._type, + discriminatorValue: discriminator, + codingPath: decoder.codingPath + ) + } + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .image(value): + try value.encode(to: encoder) + case let .text(value): + try value.encode(to: encoder) + case let .thinking(value): + try value.encode(to: encoder) + case let .toolCall(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptImageBlock`. + public struct TranscriptImageBlock: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptImageBlock/mimeType`. + public var mimeType: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptImageBlock/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case image = "image" + } + /// - Remark: Generated from `#/components/schemas/TranscriptImageBlock/type`. + public var _type: Components.Schemas.TranscriptImageBlock._TypePayload + /// Creates a new `TranscriptImageBlock`. + /// + /// - Parameters: + /// - mimeType: + /// - _type: + public init( + mimeType: Swift.String, + _type: Components.Schemas.TranscriptImageBlock._TypePayload + ) { + self.mimeType = mimeType + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case mimeType + case _type = "type" + } + } /// - Remark: Generated from `#/components/schemas/TranscriptMessage`. public struct TranscriptMessage: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/components/schemas/TranscriptMessage/attachments`. - public var attachments: [Components.Schemas.AttachmentInfo]? - /// Provider content blocks, with inline image bytes removed. - /// /// - Remark: Generated from `#/components/schemas/TranscriptMessage/blocks`. - public var blocks: OpenAPIRuntime.OpenAPIValueContainer? + public var blocks: [Components.Schemas.TranscriptBlock]? /// On a `call-started` or `call-ended` event: the call. /// /// - Remark: Generated from `#/components/schemas/TranscriptMessage/call`. @@ -9598,6 +10879,113 @@ extension Components { public var content: Swift.String /// - Remark: Generated from `#/components/schemas/TranscriptMessage/entryId`. public var entryId: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload`. + public struct FilesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value1`. + public struct Value1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value1/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value1/mimeType`. + public var mimeType: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value1/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value1/size`. + public var size: Swift.Double + /// Creates a new `Value1Payload`. + /// + /// - Parameters: + /// - id: + /// - mimeType: + /// - name: + /// - size: + public init( + id: Swift.String, + mimeType: Swift.String, + name: Swift.String, + size: Swift.Double + ) { + self.id = id + self.mimeType = mimeType + self.name = name + self.size = size + } + public enum CodingKeys: String, CodingKey { + case id + case mimeType + case name + case size + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value1`. + public var value1: Components.Schemas.TranscriptMessage.FilesPayloadPayload.Value1Payload? + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value2`. + public struct Value2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value2/deleted`. + public var deleted: Swift.Bool + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value2/id`. + public var id: Swift.String + /// Creates a new `Value2Payload`. + /// + /// - Parameters: + /// - deleted: + /// - id: + public init( + deleted: Swift.Bool, + id: Swift.String + ) { + self.deleted = deleted + self.id = id + } + public enum CodingKeys: String, CodingKey { + case deleted + case id + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/FilesPayload/value2`. + public var value2: Components.Schemas.TranscriptMessage.FilesPayloadPayload.Value2Payload? + /// Creates a new `FilesPayloadPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Components.Schemas.TranscriptMessage.FilesPayloadPayload.Value1Payload? = nil, + value2: Components.Schemas.TranscriptMessage.FilesPayloadPayload.Value2Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try .init(from: decoder) + } catch { + errors.append(error) + } + do { + self.value2 = try .init(from: decoder) + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try self.value1?.encode(to: encoder) + try self.value2?.encode(to: encoder) + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/files`. + public typealias FilesPayload = [Components.Schemas.TranscriptMessage.FilesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/files`. + public var files: Components.Schemas.TranscriptMessage.FilesPayload? /// On a `held-action` event: the desktop job action waiting for the owner. Its state is under `/v1/agents/{id}/held-actions`. /// /// - Remark: Generated from `#/components/schemas/TranscriptMessage/heldAction`. @@ -9684,8 +11072,155 @@ extension Components { public var kind: Swift.String? /// - Remark: Generated from `#/components/schemas/TranscriptMessage/origin`. public var origin: Components.Schemas.MessageOrigin? + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/presentation`. + public var presentation: Components.Schemas.MessagePresentation? /// - Remark: Generated from `#/components/schemas/TranscriptMessage/replyPreview`. public var replyPreview: Swift.String? + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload`. + public struct ReplyReferencesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/eventId`. + public var eventId: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface`. + @frozen public enum SurfacePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case1`. + public struct Case1Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case1/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case1/kind`. + public var kind: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload + /// Creates a new `Case1Payload`. + /// + /// - Parameters: + /// - kind: + public init(kind: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload.KindPayload) { + self.kind = kind + } + public enum CodingKeys: String, CodingKey { + case kind + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case1`. + case case1(Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case1Payload) + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case2`. + public struct Case2Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case2/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case toolCard = "tool-card" + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case2/kind`. + public var kind: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case2/toolCallId`. + public var toolCallId: Swift.String + /// Creates a new `Case2Payload`. + /// + /// - Parameters: + /// - kind: + /// - toolCallId: + public init( + kind: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload.KindPayload, + toolCallId: Swift.String + ) { + self.kind = kind + self.toolCallId = toolCallId + } + public enum CodingKeys: String, CodingKey { + case kind + case toolCallId + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case2`. + case case2(Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case2Payload) + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case3`. + public struct Case3Payload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case3/actionId`. + public var actionId: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case3/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case heldAction = "held-action" + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case3/kind`. + public var kind: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload + /// Creates a new `Case3Payload`. + /// + /// - Parameters: + /// - actionId: + /// - kind: + public init( + actionId: Swift.String, + kind: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload.KindPayload + ) { + self.actionId = actionId + self.kind = kind + } + public enum CodingKeys: String, CodingKey { + case actionId + case kind + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface/case3`. + case case3(Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload.Case3Payload) + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self = .case1(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case2(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + do { + self = .case3(try .init(from: decoder)) + return + } catch { + errors.append(error) + } + throw Swift.DecodingError.failedToDecodeOneOfSchema( + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + switch self { + case let .case1(value): + try value.encode(to: encoder) + case let .case2(value): + try value.encode(to: encoder) + case let .case3(value): + try value.encode(to: encoder) + } + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/ReplyReferencesPayload/surface`. + public var surface: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload + /// Creates a new `ReplyReferencesPayloadPayload`. + /// + /// - Parameters: + /// - eventId: + /// - surface: + public init( + eventId: Swift.String, + surface: Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload.SurfacePayload + ) { + self.eventId = eventId + self.surface = surface + } + public enum CodingKeys: String, CodingKey { + case eventId + case surface + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/replyReferences`. + public typealias ReplyReferencesPayload = [Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload] + /// - Remark: Generated from `#/components/schemas/TranscriptMessage/replyReferences`. + public var replyReferences: Components.Schemas.TranscriptMessage.ReplyReferencesPayload /// - Remark: Generated from `#/components/schemas/TranscriptMessage/replyTo`. public var replyTo: Swift.String? /// - Remark: Generated from `#/components/schemas/TranscriptMessage/requestId`. @@ -9738,19 +11273,21 @@ extension Components { /// Creates a new `TranscriptMessage`. /// /// - Parameters: - /// - attachments: - /// - blocks: Provider content blocks, with inline image bytes removed. + /// - blocks: /// - call: On a `call-started` or `call-ended` event: the call. /// - communication: /// - content: /// - entryId: + /// - files: /// - heldAction: On a `held-action` event: the desktop job action waiting for the owner. Its state is under `/v1/agents/{id}/held-actions`. /// - id: /// - isError: /// - jobQuestion: On a `job-question` event: the job that asked the owner the question in `content`. Whether it still waits is the job's `question` in its listing. /// - kind: The entry's kind. Events include bot-message, job-question, held-action, job-failure, reset, compaction, call-started (content: the greeting of a call the bot placed, or Call started), and call-ended (content: how the call ended, when it woke no bot turn). Clients may receive other values later. /// - origin: + /// - presentation: /// - replyPreview: + /// - replyReferences: /// - replyTo: /// - requestId: /// - role: @@ -9761,19 +11298,21 @@ extension Components { /// - toolDetails: Provider-specific tool details, including nested code-mode calls. A successful `desktop_screenshot` result has `{ mimeType, size }`; read its image from `GET /v1/agents/{id}/attachments/{entryId}/0`. /// - toolName: public init( - attachments: [Components.Schemas.AttachmentInfo]? = nil, - blocks: OpenAPIRuntime.OpenAPIValueContainer? = nil, + blocks: [Components.Schemas.TranscriptBlock]? = nil, call: Components.Schemas.TranscriptMessage.CallPayload? = nil, communication: Components.Schemas.BotCommunication? = nil, content: Swift.String, entryId: Swift.String, + files: Components.Schemas.TranscriptMessage.FilesPayload? = nil, heldAction: Components.Schemas.TranscriptMessage.HeldActionPayload? = nil, id: Swift.String, isError: Swift.Bool? = nil, jobQuestion: Components.Schemas.TranscriptMessage.JobQuestionPayload? = nil, kind: Swift.String? = nil, origin: Components.Schemas.MessageOrigin? = nil, + presentation: Components.Schemas.MessagePresentation? = nil, replyPreview: Swift.String? = nil, + replyReferences: Components.Schemas.TranscriptMessage.ReplyReferencesPayload, replyTo: Swift.String? = nil, requestId: Swift.String? = nil, role: Swift.String, @@ -9784,19 +11323,21 @@ extension Components { toolDetails: OpenAPIRuntime.OpenAPIValueContainer? = nil, toolName: Swift.String? = nil ) { - self.attachments = attachments self.blocks = blocks self.call = call self.communication = communication self.content = content self.entryId = entryId + self.files = files self.heldAction = heldAction self.id = id self.isError = isError self.jobQuestion = jobQuestion self.kind = kind self.origin = origin + self.presentation = presentation self.replyPreview = replyPreview + self.replyReferences = replyReferences self.replyTo = replyTo self.requestId = requestId self.role = role @@ -9808,19 +11349,21 @@ extension Components { self.toolName = toolName } public enum CodingKeys: String, CodingKey { - case attachments case blocks case call case communication case content case entryId + case files case heldAction case id case isError case jobQuestion case kind case origin + case presentation case replyPreview + case replyReferences case replyTo case requestId case role @@ -9861,6 +11404,146 @@ extension Components { case oldestEntryId } } + /// - Remark: Generated from `#/components/schemas/TranscriptTextBlock`. + public struct TranscriptTextBlock: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptTextBlock/text`. + public var text: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptTextBlock/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case text = "text" + } + /// - Remark: Generated from `#/components/schemas/TranscriptTextBlock/type`. + public var _type: Components.Schemas.TranscriptTextBlock._TypePayload + /// Creates a new `TranscriptTextBlock`. + /// + /// - Parameters: + /// - text: + /// - _type: + public init( + text: Swift.String, + _type: Components.Schemas.TranscriptTextBlock._TypePayload + ) { + self.text = text + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case text + case _type = "type" + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptThinkingBlock`. + public struct TranscriptThinkingBlock: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptThinkingBlock/redacted`. + public var redacted: Swift.Bool? + /// - Remark: Generated from `#/components/schemas/TranscriptThinkingBlock/thinking`. + public var thinking: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptThinkingBlock/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case thinking = "thinking" + } + /// - Remark: Generated from `#/components/schemas/TranscriptThinkingBlock/type`. + public var _type: Components.Schemas.TranscriptThinkingBlock._TypePayload + /// Creates a new `TranscriptThinkingBlock`. + /// + /// - Parameters: + /// - redacted: + /// - thinking: + /// - _type: + public init( + redacted: Swift.Bool? = nil, + thinking: Swift.String, + _type: Components.Schemas.TranscriptThinkingBlock._TypePayload + ) { + self.redacted = redacted + self.thinking = thinking + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case redacted + case thinking + case _type = "type" + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock`. + public struct TranscriptToolCallBlock: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock/arguments`. + public struct ArgumentsPayload: Codable, Hashable, Sendable { + /// A container of undocumented properties. + public var additionalProperties: [String: OpenAPIRuntime.OpenAPIValueContainer] + /// Creates a new `ArgumentsPayload`. + /// + /// - Parameters: + /// - additionalProperties: A container of undocumented properties. + public init(additionalProperties: [String: OpenAPIRuntime.OpenAPIValueContainer] = .init()) { + self.additionalProperties = additionalProperties + } + public init(from decoder: any Swift.Decoder) throws { + additionalProperties = try decoder.decodeAdditionalProperties(knownKeys: []) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeAdditionalProperties(additionalProperties) + } + } + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock/arguments`. + public var arguments: Components.Schemas.TranscriptToolCallBlock.ArgumentsPayload + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock/id`. + public var id: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock/name`. + public var name: Swift.String + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock/type`. + @frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable { + case toolCall = "toolCall" + } + /// - Remark: Generated from `#/components/schemas/TranscriptToolCallBlock/type`. + public var _type: Components.Schemas.TranscriptToolCallBlock._TypePayload + /// Creates a new `TranscriptToolCallBlock`. + /// + /// - Parameters: + /// - arguments: + /// - id: + /// - name: + /// - _type: + public init( + arguments: Components.Schemas.TranscriptToolCallBlock.ArgumentsPayload, + id: Swift.String, + name: Swift.String, + _type: Components.Schemas.TranscriptToolCallBlock._TypePayload + ) { + self.arguments = arguments + self.id = id + self.name = name + self._type = _type + } + public enum CodingKeys: String, CodingKey { + case arguments + case id + case name + case _type = "type" + } + } + /// - Remark: Generated from `#/components/schemas/UploadFile`. + public struct UploadFile: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/components/schemas/UploadFile/existed`. + public var existed: Swift.Bool + /// - Remark: Generated from `#/components/schemas/UploadFile/file`. + public var file: Components.Schemas.LibraryFile + /// Creates a new `UploadFile`. + /// + /// - Parameters: + /// - existed: + /// - file: + public init( + existed: Swift.Bool, + file: Components.Schemas.LibraryFile + ) { + self.existed = existed + self.file = file + } + public enum CodingKeys: String, CodingKey { + case existed + case file + } + } /// - Remark: Generated from `#/components/schemas/VisionChoice`. public struct VisionChoice: Codable, Hashable, Sendable { /// - Remark: Generated from `#/components/schemas/VisionChoice/model`. diff --git a/apfelkern/Sources/apfelkern/Generated/Types+Operations.swift b/apfelkern/Sources/apfelkern/Generated/Types+Operations.swift index e78390e..b5cb402 100644 --- a/apfelkern/Sources/apfelkern/Generated/Types+Operations.swift +++ b/apfelkern/Sources/apfelkern/Generated/Types+Operations.swift @@ -17370,12 +17370,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/v1/agents/{id}/coding-jobs/{name}/history/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/v1/agents/{id}/coding-jobs/{name}/history/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TranscriptPage) + case json(Components.Schemas.JobHistoryPage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.TranscriptPage { + public var json: Components.Schemas.JobHistoryPage { get throws { switch self { case let .json(body): @@ -21847,12 +21847,12 @@ public enum Operations { /// - Remark: Generated from `#/paths/v1/agents/{id}/desktop-jobs/{name}/history/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/v1/agents/{id}/desktop-jobs/{name}/history/GET/responses/200/content/application\/json`. - case json(Components.Schemas.TranscriptPage) + case json(Components.Schemas.JobHistoryPage) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.TranscriptPage { + public var json: Components.Schemas.JobHistoryPage { get throws { switch self { case let .json(body): @@ -26515,16 +26515,14 @@ public enum Operations { } } } - /// Desktop job actions an intent check held for the owner, newest first, pending and decided. - /// - /// - Remark: HTTP `GET /v1/agents/{id}/held-actions`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)`. - public enum ListAgentHeldActions { - public static let id: Swift.String = "listAgentHeldActions" + /// - Remark: HTTP `GET /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)`. + public enum ListFiles { + public static let id: Swift.String = "listFiles" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -26534,43 +26532,66 @@ public enum Operations { self.id = id } } - public var path: Operations.ListAgentHeldActions.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/header`. + public var path: Operations.ListFiles.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/query/before`. + public var before: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/query/limit`. + public var limit: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - before: + /// - limit: + public init( + before: Swift.String? = nil, + limit: Swift.Int? = nil + ) { + self.before = before + self.limit = limit + } + } + public var query: Operations.ListFiles.Input.Query + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListAgentHeldActions.Input.Headers + public var headers: Operations.ListFiles.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.ListAgentHeldActions.Input.Path, - headers: Operations.ListAgentHeldActions.Input.Headers = .init() + path: Operations.ListFiles.Input.Path, + query: Operations.ListFiles.Input.Query = .init(), + headers: Operations.ListFiles.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.HeldAction]) + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/200/content/application\/json`. + case json([Components.Schemas.LibraryFile]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.HeldAction] { + public var json: [Components.Schemas.LibraryFile] { get throws { switch self { case let .json(body): @@ -26580,26 +26601,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.Ok.Body + public var body: Operations.ListFiles.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.Ok.Body) { + public init(body: Operations.ListFiles.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListAgentHeldActions.Output.Ok) + case ok(Operations.ListFiles.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListAgentHeldActions.Output.Ok { + public var ok: Operations.ListFiles.Output.Ok { get throws { switch self { case let .ok(response): @@ -26613,9 +26634,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -26631,26 +26652,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.BadRequest.Body + public var body: Operations.ListFiles.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.BadRequest.Body) { + public init(body: Operations.ListFiles.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListAgentHeldActions.Output.BadRequest) + case badRequest(Operations.ListFiles.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListAgentHeldActions.Output.BadRequest { + public var badRequest: Operations.ListFiles.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -26664,9 +26685,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -26682,26 +26703,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.Unauthorized.Body + public var body: Operations.ListFiles.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.Unauthorized.Body) { + public init(body: Operations.ListFiles.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListAgentHeldActions.Output.Unauthorized) + case unauthorized(Operations.ListFiles.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListAgentHeldActions.Output.Unauthorized { + public var unauthorized: Operations.ListFiles.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -26715,9 +26736,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -26733,26 +26754,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.NotFound.Body + public var body: Operations.ListFiles.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.NotFound.Body) { + public init(body: Operations.ListFiles.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListAgentHeldActions.Output.NotFound) + case notFound(Operations.ListFiles.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListAgentHeldActions.Output.NotFound { + public var notFound: Operations.ListFiles.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -26766,9 +26787,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -26784,26 +26805,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.MethodNotAllowed.Body + public var body: Operations.ListFiles.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListFiles.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListAgentHeldActions.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListFiles.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListAgentHeldActions.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListFiles.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -26817,9 +26838,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -26835,26 +26856,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.Conflict.Body + public var body: Operations.ListFiles.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.Conflict.Body) { + public init(body: Operations.ListFiles.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListAgentHeldActions.Output.Conflict) + case conflict(Operations.ListFiles.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListAgentHeldActions.Output.Conflict { + public var conflict: Operations.ListFiles.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -26868,9 +26889,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -26886,26 +26907,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.ContentTooLarge.Body + public var body: Operations.ListFiles.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.ContentTooLarge.Body) { + public init(body: Operations.ListFiles.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListAgentHeldActions.Output.ContentTooLarge) + case contentTooLarge(Operations.ListFiles.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListAgentHeldActions.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListFiles.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -26919,9 +26940,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -26937,26 +26958,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.InternalServerError.Body + public var body: Operations.ListFiles.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.InternalServerError.Body) { + public init(body: Operations.ListFiles.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListAgentHeldActions.Output.InternalServerError) + case internalServerError(Operations.ListFiles.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListAgentHeldActions.Output.InternalServerError { + public var internalServerError: Operations.ListFiles.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -26970,9 +26991,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -26988,26 +27009,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentHeldActions.Output.ServiceUnavailable.Body + public var body: Operations.ListFiles.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentHeldActions.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListFiles.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListAgentHeldActions.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListFiles.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListAgentHeldActions.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListFiles.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -27057,69 +27078,76 @@ public enum Operations { } } } - /// Runs the held action; the job continues where it stopped. Fails with 409 once the action was decided. - /// - /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/approve`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)`. - public enum ApproveAgentHeldAction { - public static let id: Swift.String = "approveAgentHeldAction" + /// - Remark: HTTP `POST /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)`. + public enum UploadFile { + public static let id: Swift.String = "uploadFile" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/path/actionId`. - public var actionId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - actionId: - public init( - id: Swift.String, - actionId: Swift.String - ) { + public init(id: Swift.String) { self.id = id - self.actionId = actionId } } - public var path: Operations.ApproveAgentHeldAction.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/header`. + public var path: Operations.UploadFile.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/header/x-file-name`. + public var xFileName: Swift.String + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: + /// - xFileName: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init( + xFileName: Swift.String, + accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues() + ) { + self.xFileName = xFileName self.accept = accept } } - public var headers: Operations.ApproveAgentHeldAction.Input.Headers + public var headers: Operations.UploadFile.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/requestBody/content/*\/*`. + case any(OpenAPIRuntime.HTTPBody) + } + public var body: Operations.UploadFile.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ApproveAgentHeldAction.Input.Path, - headers: Operations.ApproveAgentHeldAction.Input.Headers = .init() + path: Operations.UploadFile.Input.Path, + headers: Operations.UploadFile.Input.Headers, + body: Operations.UploadFile.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/200/content/application\/json`. - case json(Components.Schemas.HeldAction) + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/201/content/application\/json`. + case json(Components.Schemas.UploadFile) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.HeldAction { + public var json: Components.Schemas.UploadFile { get throws { switch self { case let .json(body): @@ -27129,42 +27157,42 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.UploadFile.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.Ok.Body) { + public init(body: Operations.UploadFile.Output.Created.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ApproveAgentHeldAction.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.UploadFile.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ApproveAgentHeldAction.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.UploadFile.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27180,26 +27208,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.BadRequest.Body + public var body: Operations.UploadFile.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.BadRequest.Body) { + public init(body: Operations.UploadFile.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ApproveAgentHeldAction.Output.BadRequest) + case badRequest(Operations.UploadFile.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ApproveAgentHeldAction.Output.BadRequest { + public var badRequest: Operations.UploadFile.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -27213,9 +27241,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -27231,26 +27259,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.Unauthorized.Body + public var body: Operations.UploadFile.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.Unauthorized.Body) { + public init(body: Operations.UploadFile.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ApproveAgentHeldAction.Output.Unauthorized) + case unauthorized(Operations.UploadFile.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ApproveAgentHeldAction.Output.Unauthorized { + public var unauthorized: Operations.UploadFile.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -27264,9 +27292,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27282,26 +27310,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.NotFound.Body + public var body: Operations.UploadFile.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.NotFound.Body) { + public init(body: Operations.UploadFile.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ApproveAgentHeldAction.Output.NotFound) + case notFound(Operations.UploadFile.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ApproveAgentHeldAction.Output.NotFound { + public var notFound: Operations.UploadFile.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -27315,9 +27343,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27333,26 +27361,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed.Body + public var body: Operations.UploadFile.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed.Body) { + public init(body: Operations.UploadFile.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ApproveAgentHeldAction.Output.MethodNotAllowed) + case methodNotAllowed(Operations.UploadFile.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.UploadFile.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -27366,9 +27394,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27384,26 +27412,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.Conflict.Body + public var body: Operations.UploadFile.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.Conflict.Body) { + public init(body: Operations.UploadFile.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ApproveAgentHeldAction.Output.Conflict) + case conflict(Operations.UploadFile.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ApproveAgentHeldAction.Output.Conflict { + public var conflict: Operations.UploadFile.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -27417,9 +27445,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -27435,26 +27463,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.ContentTooLarge.Body + public var body: Operations.UploadFile.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.ContentTooLarge.Body) { + public init(body: Operations.UploadFile.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ApproveAgentHeldAction.Output.ContentTooLarge) + case contentTooLarge(Operations.UploadFile.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ApproveAgentHeldAction.Output.ContentTooLarge { + public var contentTooLarge: Operations.UploadFile.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -27468,9 +27496,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27486,26 +27514,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.InternalServerError.Body + public var body: Operations.UploadFile.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.InternalServerError.Body) { + public init(body: Operations.UploadFile.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ApproveAgentHeldAction.Output.InternalServerError) + case internalServerError(Operations.UploadFile.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ApproveAgentHeldAction.Output.InternalServerError { + public var internalServerError: Operations.UploadFile.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -27519,9 +27547,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27537,26 +27565,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable.Body + public var body: Operations.UploadFile.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable.Body) { + public init(body: Operations.UploadFile.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ApproveAgentHeldAction.Output.ServiceUnavailable) + case serviceUnavailable(Operations.UploadFile.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.UploadFile.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -27606,122 +27634,96 @@ public enum Operations { } } } - /// Refuses the held action with an optional reason; the job reports back. Fails with 409 once the action was decided. - /// - /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/decline`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)`. - public enum DeclineAgentHeldAction { - public static let id: Swift.String = "declineAgentHeldAction" + /// - Remark: HTTP `GET /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)`. + public enum GetFile { + public static let id: Swift.String = "getFile" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/path/actionId`. - public var actionId: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/path/fileId`. + public var fileId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - actionId: + /// - fileId: public init( id: Swift.String, - actionId: Swift.String + fileId: Swift.String ) { self.id = id - self.actionId = actionId + self.fileId = fileId } } - public var path: Operations.DeclineAgentHeldAction.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/header`. + public var path: Operations.GetFile.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeclineAgentHeldAction.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody/json/reason`. - public var reason: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - reason: - public init(reason: Swift.String? = nil) { - self.reason = reason - } - public enum CodingKeys: String, CodingKey { - case reason - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody/content/application\/json`. - case json(Operations.DeclineAgentHeldAction.Input.Body.JsonPayload) - } - public var body: Operations.DeclineAgentHeldAction.Input.Body + public var headers: Operations.GetFile.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.DeclineAgentHeldAction.Input.Path, - headers: Operations.DeclineAgentHeldAction.Input.Headers = .init(), - body: Operations.DeclineAgentHeldAction.Input.Body + path: Operations.GetFile.Input.Path, + headers: Operations.GetFile.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/200/content/application\/json`. - case json(Components.Schemas.HeldAction) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/200/content/application\/octet-stream`. + case binary(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.binary`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.HeldAction { + /// - Throws: An error if `self` is not `.binary`. + /// - SeeAlso: `.binary`. + public var binary: OpenAPIRuntime.HTTPBody { get throws { switch self { - case let .json(body): + case let .binary(body): return body } } } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.Ok.Body + public var body: Operations.GetFile.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.Ok.Body) { + public init(body: Operations.GetFile.Output.Ok.Body) { self.body = body } } - /// Success + /// File bytes with safe download headers /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.DeclineAgentHeldAction.Output.Ok) + case ok(Operations.GetFile.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.DeclineAgentHeldAction.Output.Ok { + public var ok: Operations.GetFile.Output.Ok { get throws { switch self { case let .ok(response): @@ -27735,9 +27737,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27753,26 +27755,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.BadRequest.Body + public var body: Operations.GetFile.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.BadRequest.Body) { + public init(body: Operations.GetFile.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeclineAgentHeldAction.Output.BadRequest) + case badRequest(Operations.GetFile.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeclineAgentHeldAction.Output.BadRequest { + public var badRequest: Operations.GetFile.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -27786,9 +27788,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -27804,26 +27806,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.Unauthorized.Body + public var body: Operations.GetFile.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.Unauthorized.Body) { + public init(body: Operations.GetFile.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeclineAgentHeldAction.Output.Unauthorized) + case unauthorized(Operations.GetFile.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeclineAgentHeldAction.Output.Unauthorized { + public var unauthorized: Operations.GetFile.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -27837,9 +27839,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27855,26 +27857,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.NotFound.Body + public var body: Operations.GetFile.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.NotFound.Body) { + public init(body: Operations.GetFile.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeclineAgentHeldAction.Output.NotFound) + case notFound(Operations.GetFile.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeclineAgentHeldAction.Output.NotFound { + public var notFound: Operations.GetFile.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -27888,9 +27890,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27906,26 +27908,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed.Body + public var body: Operations.GetFile.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed.Body) { + public init(body: Operations.GetFile.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeclineAgentHeldAction.Output.MethodNotAllowed) + case methodNotAllowed(Operations.GetFile.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.GetFile.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -27939,9 +27941,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -27957,26 +27959,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.Conflict.Body + public var body: Operations.GetFile.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.Conflict.Body) { + public init(body: Operations.GetFile.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeclineAgentHeldAction.Output.Conflict) + case conflict(Operations.GetFile.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeclineAgentHeldAction.Output.Conflict { + public var conflict: Operations.GetFile.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -27990,9 +27992,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -28008,26 +28010,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.ContentTooLarge.Body + public var body: Operations.GetFile.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.ContentTooLarge.Body) { + public init(body: Operations.GetFile.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeclineAgentHeldAction.Output.ContentTooLarge) + case contentTooLarge(Operations.GetFile.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeclineAgentHeldAction.Output.ContentTooLarge { + public var contentTooLarge: Operations.GetFile.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -28041,9 +28043,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28059,26 +28061,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.InternalServerError.Body + public var body: Operations.GetFile.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.InternalServerError.Body) { + public init(body: Operations.GetFile.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeclineAgentHeldAction.Output.InternalServerError) + case internalServerError(Operations.GetFile.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeclineAgentHeldAction.Output.InternalServerError { + public var internalServerError: Operations.GetFile.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -28092,9 +28094,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28110,26 +28112,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable.Body + public var body: Operations.GetFile.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable.Body) { + public init(body: Operations.GetFile.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeclineAgentHeldAction.Output.ServiceUnavailable) + case serviceUnavailable(Operations.GetFile.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.GetFile.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -28148,11 +28150,14 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { + case binary case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { + case "application/octet-stream": + self = .binary case "application/json": self = .json case "text/plain": @@ -28165,6 +28170,8 @@ public enum Operations { switch self { case let .other(string): return string + case .binary: + return "application/octet-stream" case .json: return "application/json" case .plainText: @@ -28173,113 +28180,103 @@ public enum Operations { } public static var allCases: [Self] { [ + .binary, .json, .plainText ] } } } - /// The logins the bot's desktop jobs can fill into web pages, and its requests for logins the owner has not answered. Values are never returned. - /// - /// - Remark: HTTP `GET /v1/agents/{id}/logins`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)`. - public enum ListAgentLogins { - public static let id: Swift.String = "listAgentLogins" + /// - Remark: HTTP `DELETE /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)`. + public enum DeleteFile { + public static let id: Swift.String = "deleteFile" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/path/id`. public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/path/fileId`. + public var fileId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - public init(id: Swift.String) { + /// - fileId: + public init( + id: Swift.String, + fileId: Swift.String + ) { self.id = id + self.fileId = fileId } } - public var path: Operations.ListAgentLogins.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/header`. + public var path: Operations.DeleteFile.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListAgentLogins.Input.Headers + public var headers: Operations.DeleteFile.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.ListAgentLogins.Input.Path, - headers: Operations.ListAgentLogins.Input.Headers = .init() + path: Operations.DeleteFile.Input.Path, + headers: Operations.DeleteFile.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Logins) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Logins { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ListAgentLogins.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteFile.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ListAgentLogins.Output.Ok { + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteFile.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28295,26 +28292,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.BadRequest.Body + public var body: Operations.DeleteFile.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.BadRequest.Body) { + public init(body: Operations.DeleteFile.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListAgentLogins.Output.BadRequest) + case badRequest(Operations.DeleteFile.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListAgentLogins.Output.BadRequest { + public var badRequest: Operations.DeleteFile.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -28328,9 +28325,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -28346,26 +28343,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.Unauthorized.Body + public var body: Operations.DeleteFile.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.Unauthorized.Body) { + public init(body: Operations.DeleteFile.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListAgentLogins.Output.Unauthorized) + case unauthorized(Operations.DeleteFile.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListAgentLogins.Output.Unauthorized { + public var unauthorized: Operations.DeleteFile.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -28379,9 +28376,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28397,26 +28394,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.NotFound.Body + public var body: Operations.DeleteFile.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.NotFound.Body) { + public init(body: Operations.DeleteFile.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListAgentLogins.Output.NotFound) + case notFound(Operations.DeleteFile.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListAgentLogins.Output.NotFound { + public var notFound: Operations.DeleteFile.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -28430,9 +28427,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28448,26 +28445,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.MethodNotAllowed.Body + public var body: Operations.DeleteFile.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteFile.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListAgentLogins.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteFile.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListAgentLogins.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteFile.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -28481,9 +28478,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28499,26 +28496,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.Conflict.Body + public var body: Operations.DeleteFile.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.Conflict.Body) { + public init(body: Operations.DeleteFile.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListAgentLogins.Output.Conflict) + case conflict(Operations.DeleteFile.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListAgentLogins.Output.Conflict { + public var conflict: Operations.DeleteFile.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -28532,9 +28529,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -28550,26 +28547,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.ContentTooLarge.Body + public var body: Operations.DeleteFile.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteFile.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListAgentLogins.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteFile.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListAgentLogins.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteFile.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -28583,9 +28580,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28601,26 +28598,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.InternalServerError.Body + public var body: Operations.DeleteFile.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.InternalServerError.Body) { + public init(body: Operations.DeleteFile.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListAgentLogins.Output.InternalServerError) + case internalServerError(Operations.DeleteFile.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListAgentLogins.Output.InternalServerError { + public var internalServerError: Operations.DeleteFile.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -28634,9 +28631,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/files/{fileId}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -28652,26 +28649,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLogins.Output.ServiceUnavailable.Body + public var body: Operations.DeleteFile.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLogins.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteFile.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListAgentLogins.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteFile.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListAgentLogins.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteFile.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -28721,361 +28718,62 @@ public enum Operations { } } } - /// Creates or updates a login. Saving one the bot requested answers the request and starts a bot turn with a notice. Each field is a value stored in Crumble or a password manager reference; a 1Password `item` fills every field. Every reference is read once to check it, and nothing is saved if one fails. + /// Desktop job actions an intent check held for the owner, newest first, pending and decided. /// - /// - Remark: HTTP `PUT /v1/agents/{id}/logins/{name}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)`. - public enum SaveAgentLogin { - public static let id: Swift.String = "saveAgentLogin" + /// - Remark: HTTP `GET /v1/agents/{id}/held-actions`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)`. + public enum ListAgentHeldActions { + public static let id: Swift.String = "listAgentHeldActions" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/path/name`. - public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - name: - public init( - id: Swift.String, - name: Swift.String - ) { + public init(id: Swift.String) { self.id = id - self.name = name } } - public var path: Operations.SaveAgentLogin.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/header`. + public var path: Operations.ListAgentHeldActions.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SaveAgentLogin.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields`. - public struct FieldsPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code`. - public struct OneTimeCodePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference`. - public struct ReferencePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference/passwordManager`. - @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _1password = "1password" - case bitwarden = "bitwarden" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference/passwordManager`. - public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference/reference`. - public var reference: Swift.String - /// Creates a new `ReferencePayload`. - /// - /// - Parameters: - /// - passwordManager: - /// - reference: - public init( - passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload.PasswordManagerPayload, - reference: Swift.String - ) { - self.passwordManager = passwordManager - self.reference = reference - } - public enum CodingKeys: String, CodingKey { - case passwordManager - case reference - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference`. - public var reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/value`. - public var value: Swift.String? - /// Creates a new `OneTimeCodePayload`. - /// - /// - Parameters: - /// - reference: - /// - value: - public init( - reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload? = nil, - value: Swift.String? = nil - ) { - self.reference = reference - self.value = value - } - public enum CodingKeys: String, CodingKey { - case reference - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.reference = try container.decodeIfPresent( - Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload.self, - forKey: .reference - ) - self.value = try container.decodeIfPresent( - Swift.String.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "reference", - "value" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code`. - public var oneTimeCode: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password`. - public struct PasswordPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference`. - public struct ReferencePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference/passwordManager`. - @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _1password = "1password" - case bitwarden = "bitwarden" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference/passwordManager`. - public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference/reference`. - public var reference: Swift.String - /// Creates a new `ReferencePayload`. - /// - /// - Parameters: - /// - passwordManager: - /// - reference: - public init( - passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload.PasswordManagerPayload, - reference: Swift.String - ) { - self.passwordManager = passwordManager - self.reference = reference - } - public enum CodingKeys: String, CodingKey { - case passwordManager - case reference - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference`. - public var reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/value`. - public var value: Swift.String? - /// Creates a new `PasswordPayload`. - /// - /// - Parameters: - /// - reference: - /// - value: - public init( - reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload? = nil, - value: Swift.String? = nil - ) { - self.reference = reference - self.value = value - } - public enum CodingKeys: String, CodingKey { - case reference - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.reference = try container.decodeIfPresent( - Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload.self, - forKey: .reference - ) - self.value = try container.decodeIfPresent( - Swift.String.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "reference", - "value" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password`. - public var password: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username`. - public struct UsernamePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference`. - public struct ReferencePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference/passwordManager`. - @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _1password = "1password" - case bitwarden = "bitwarden" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference/passwordManager`. - public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference/reference`. - public var reference: Swift.String - /// Creates a new `ReferencePayload`. - /// - /// - Parameters: - /// - passwordManager: - /// - reference: - public init( - passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload.PasswordManagerPayload, - reference: Swift.String - ) { - self.passwordManager = passwordManager - self.reference = reference - } - public enum CodingKeys: String, CodingKey { - case passwordManager - case reference - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference`. - public var reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/value`. - public var value: Swift.String? - /// Creates a new `UsernamePayload`. - /// - /// - Parameters: - /// - reference: - /// - value: - public init( - reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload? = nil, - value: Swift.String? = nil - ) { - self.reference = reference - self.value = value - } - public enum CodingKeys: String, CodingKey { - case reference - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.reference = try container.decodeIfPresent( - Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload.self, - forKey: .reference - ) - self.value = try container.decodeIfPresent( - Swift.String.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "reference", - "value" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username`. - public var username: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload? - /// Creates a new `FieldsPayload`. - /// - /// - Parameters: - /// - oneTimeCode: - /// - password: - /// - username: - public init( - oneTimeCode: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload? = nil, - password: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload? = nil, - username: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload? = nil - ) { - self.oneTimeCode = oneTimeCode - self.password = password - self.username = username - } - public enum CodingKeys: String, CodingKey { - case oneTimeCode = "one_time_code" - case password - case username - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields`. - public var fields: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/hosts`. - public var hosts: [Swift.String]? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item`. - public struct ItemPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item/passwordManager`. - @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _1password = "1password" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item/passwordManager`. - public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item/reference`. - public var reference: Swift.String - /// Creates a new `ItemPayload`. - /// - /// - Parameters: - /// - passwordManager: - /// - reference: - public init( - passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload.PasswordManagerPayload, - reference: Swift.String - ) { - self.passwordManager = passwordManager - self.reference = reference - } - public enum CodingKeys: String, CodingKey { - case passwordManager - case reference - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item`. - public var item: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - fields: - /// - hosts: - /// - item: - public init( - fields: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload? = nil, - hosts: [Swift.String]? = nil, - item: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload? = nil - ) { - self.fields = fields - self.hosts = hosts - self.item = item - } - public enum CodingKeys: String, CodingKey { - case fields - case hosts - case item - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/content/application\/json`. - case json(Operations.SaveAgentLogin.Input.Body.JsonPayload) - } - public var body: Operations.SaveAgentLogin.Input.Body + public var headers: Operations.ListAgentHeldActions.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.SaveAgentLogin.Input.Path, - headers: Operations.SaveAgentLogin.Input.Headers = .init(), - body: Operations.SaveAgentLogin.Input.Body + path: Operations.ListAgentHeldActions.Input.Path, + headers: Operations.ListAgentHeldActions.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.Login) + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/200/content/application\/json`. + case json([Components.Schemas.HeldAction]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Login { + public var json: [Components.Schemas.HeldAction] { get throws { switch self { case let .json(body): @@ -29085,26 +28783,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.Ok.Body + public var body: Operations.ListAgentHeldActions.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.Ok.Body) { + public init(body: Operations.ListAgentHeldActions.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SaveAgentLogin.Output.Ok) + case ok(Operations.ListAgentHeldActions.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SaveAgentLogin.Output.Ok { + public var ok: Operations.ListAgentHeldActions.Output.Ok { get throws { switch self { case let .ok(response): @@ -29118,9 +28816,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29136,26 +28834,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.BadRequest.Body + public var body: Operations.ListAgentHeldActions.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.BadRequest.Body) { + public init(body: Operations.ListAgentHeldActions.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SaveAgentLogin.Output.BadRequest) + case badRequest(Operations.ListAgentHeldActions.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SaveAgentLogin.Output.BadRequest { + public var badRequest: Operations.ListAgentHeldActions.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -29169,9 +28867,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -29187,26 +28885,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.Unauthorized.Body + public var body: Operations.ListAgentHeldActions.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.Unauthorized.Body) { + public init(body: Operations.ListAgentHeldActions.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SaveAgentLogin.Output.Unauthorized) + case unauthorized(Operations.ListAgentHeldActions.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SaveAgentLogin.Output.Unauthorized { + public var unauthorized: Operations.ListAgentHeldActions.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -29220,9 +28918,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29238,26 +28936,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.NotFound.Body + public var body: Operations.ListAgentHeldActions.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.NotFound.Body) { + public init(body: Operations.ListAgentHeldActions.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SaveAgentLogin.Output.NotFound) + case notFound(Operations.ListAgentHeldActions.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SaveAgentLogin.Output.NotFound { + public var notFound: Operations.ListAgentHeldActions.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -29271,9 +28969,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29289,26 +28987,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.MethodNotAllowed.Body + public var body: Operations.ListAgentHeldActions.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListAgentHeldActions.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SaveAgentLogin.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListAgentHeldActions.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SaveAgentLogin.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListAgentHeldActions.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -29322,9 +29020,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29340,26 +29038,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.Conflict.Body + public var body: Operations.ListAgentHeldActions.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.Conflict.Body) { + public init(body: Operations.ListAgentHeldActions.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SaveAgentLogin.Output.Conflict) + case conflict(Operations.ListAgentHeldActions.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SaveAgentLogin.Output.Conflict { + public var conflict: Operations.ListAgentHeldActions.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -29373,9 +29071,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -29391,26 +29089,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.ContentTooLarge.Body + public var body: Operations.ListAgentHeldActions.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.ContentTooLarge.Body) { + public init(body: Operations.ListAgentHeldActions.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SaveAgentLogin.Output.ContentTooLarge) + case contentTooLarge(Operations.ListAgentHeldActions.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SaveAgentLogin.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListAgentHeldActions.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -29424,9 +29122,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29442,26 +29140,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.InternalServerError.Body + public var body: Operations.ListAgentHeldActions.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.InternalServerError.Body) { + public init(body: Operations.ListAgentHeldActions.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SaveAgentLogin.Output.InternalServerError) + case internalServerError(Operations.ListAgentHeldActions.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SaveAgentLogin.Output.InternalServerError { + public var internalServerError: Operations.ListAgentHeldActions.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -29475,9 +29173,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29493,26 +29191,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SaveAgentLogin.Output.ServiceUnavailable.Body + public var body: Operations.ListAgentHeldActions.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SaveAgentLogin.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListAgentHeldActions.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/get(listAgentHeldActions)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SaveAgentLogin.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListAgentHeldActions.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SaveAgentLogin.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListAgentHeldActions.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -29562,98 +29260,114 @@ public enum Operations { } } } - /// Deletes a login and its fill records, or declines a request for one, which starts a bot turn with a notice. + /// Runs the held action; the job continues where it stopped. Fails with 409 once the action was decided. /// - /// - Remark: HTTP `DELETE /v1/agents/{id}/logins/{name}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)`. - public enum DeleteAgentLogin { - public static let id: Swift.String = "deleteAgentLogin" + /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/approve`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)`. + public enum ApproveAgentHeldAction { + public static let id: Swift.String = "approveAgentHeldAction" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/path/name`. - public var name: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/path/actionId`. + public var actionId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - name: + /// - actionId: public init( id: Swift.String, - name: Swift.String + actionId: Swift.String ) { self.id = id - self.name = name + self.actionId = actionId } } - public var path: Operations.DeleteAgentLogin.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/header`. + public var path: Operations.ApproveAgentHeldAction.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeleteAgentLogin.Input.Headers + public var headers: Operations.ApproveAgentHeldAction.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.DeleteAgentLogin.Input.Path, - headers: Operations.DeleteAgentLogin.Input.Headers = .init() + path: Operations.ApproveAgentHeldAction.Input.Path, + headers: Operations.ApproveAgentHeldAction.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/200/content/application\/json`. + case json(Components.Schemas.HeldAction) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.HeldAction { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ApproveAgentHeldAction.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ApproveAgentHeldAction.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteAgentLogin.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/204`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ApproveAgentHeldAction.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteAgentLogin.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ApproveAgentHeldAction.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29669,26 +29383,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.BadRequest.Body + public var body: Operations.ApproveAgentHeldAction.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.BadRequest.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteAgentLogin.Output.BadRequest) + case badRequest(Operations.ApproveAgentHeldAction.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteAgentLogin.Output.BadRequest { + public var badRequest: Operations.ApproveAgentHeldAction.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -29702,9 +29416,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -29720,26 +29434,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.Unauthorized.Body + public var body: Operations.ApproveAgentHeldAction.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.Unauthorized.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteAgentLogin.Output.Unauthorized) + case unauthorized(Operations.ApproveAgentHeldAction.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteAgentLogin.Output.Unauthorized { + public var unauthorized: Operations.ApproveAgentHeldAction.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -29753,9 +29467,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29771,26 +29485,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.NotFound.Body + public var body: Operations.ApproveAgentHeldAction.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.NotFound.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteAgentLogin.Output.NotFound) + case notFound(Operations.ApproveAgentHeldAction.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteAgentLogin.Output.NotFound { + public var notFound: Operations.ApproveAgentHeldAction.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -29804,9 +29518,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29822,26 +29536,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.MethodNotAllowed.Body + public var body: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.MethodNotAllowed.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteAgentLogin.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ApproveAgentHeldAction.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteAgentLogin.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ApproveAgentHeldAction.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -29855,9 +29569,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29873,26 +29587,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.Conflict.Body + public var body: Operations.ApproveAgentHeldAction.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.Conflict.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteAgentLogin.Output.Conflict) + case conflict(Operations.ApproveAgentHeldAction.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteAgentLogin.Output.Conflict { + public var conflict: Operations.ApproveAgentHeldAction.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -29906,9 +29620,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -29924,26 +29638,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.ContentTooLarge.Body + public var body: Operations.ApproveAgentHeldAction.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.ContentTooLarge.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteAgentLogin.Output.ContentTooLarge) + case contentTooLarge(Operations.ApproveAgentHeldAction.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteAgentLogin.Output.ContentTooLarge { + public var contentTooLarge: Operations.ApproveAgentHeldAction.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -29957,9 +29671,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -29975,26 +29689,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.InternalServerError.Body + public var body: Operations.ApproveAgentHeldAction.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.InternalServerError.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteAgentLogin.Output.InternalServerError) + case internalServerError(Operations.ApproveAgentHeldAction.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteAgentLogin.Output.InternalServerError { + public var internalServerError: Operations.ApproveAgentHeldAction.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -30008,9 +29722,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/approve/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30026,26 +29740,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentLogin.Output.ServiceUnavailable.Body + public var body: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentLogin.Output.ServiceUnavailable.Body) { + public init(body: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/approve/post(approveAgentHeldAction)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteAgentLogin.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ApproveAgentHeldAction.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteAgentLogin.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ApproveAgentHeldAction.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -30095,98 +29809,138 @@ public enum Operations { } } } - /// Declines a pending login request without changing a saved login. + /// Refuses the held action with an optional reason; the job reports back. Fails with 409 once the action was decided. /// - /// - Remark: HTTP `POST /v1/agents/{id}/logins/{name}/decline`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)`. - public enum DeclineAgentLogin { - public static let id: Swift.String = "declineAgentLogin" + /// - Remark: HTTP `POST /v1/agents/{id}/held-actions/{actionId}/decline`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)`. + public enum DeclineAgentHeldAction { + public static let id: Swift.String = "declineAgentHeldAction" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/path/name`. - public var name: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/path/actionId`. + public var actionId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - name: + /// - actionId: public init( id: Swift.String, - name: Swift.String + actionId: Swift.String ) { self.id = id - self.name = name + self.actionId = actionId } } - public var path: Operations.DeclineAgentLogin.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/header`. + public var path: Operations.DeclineAgentHeldAction.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeclineAgentLogin.Input.Headers + public var headers: Operations.DeclineAgentHeldAction.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody/json/reason`. + public var reason: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - reason: + public init(reason: Swift.String? = nil) { + self.reason = reason + } + public enum CodingKeys: String, CodingKey { + case reason + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/requestBody/content/application\/json`. + case json(Operations.DeclineAgentHeldAction.Input.Body.JsonPayload) + } + public var body: Operations.DeclineAgentHeldAction.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.DeclineAgentLogin.Input.Path, - headers: Operations.DeclineAgentLogin.Input.Headers = .init() + path: Operations.DeclineAgentHeldAction.Input.Path, + headers: Operations.DeclineAgentHeldAction.Input.Headers = .init(), + body: Operations.DeclineAgentHeldAction.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/200/content/application\/json`. + case json(Components.Schemas.HeldAction) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.HeldAction { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeclineAgentHeldAction.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeclineAgentHeldAction.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeclineAgentLogin.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/204`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.DeclineAgentHeldAction.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeclineAgentLogin.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.DeclineAgentHeldAction.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30202,26 +29956,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.BadRequest.Body + public var body: Operations.DeclineAgentHeldAction.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.BadRequest.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeclineAgentLogin.Output.BadRequest) + case badRequest(Operations.DeclineAgentHeldAction.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeclineAgentLogin.Output.BadRequest { + public var badRequest: Operations.DeclineAgentHeldAction.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -30235,9 +29989,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -30253,26 +30007,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.Unauthorized.Body + public var body: Operations.DeclineAgentHeldAction.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.Unauthorized.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeclineAgentLogin.Output.Unauthorized) + case unauthorized(Operations.DeclineAgentHeldAction.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeclineAgentLogin.Output.Unauthorized { + public var unauthorized: Operations.DeclineAgentHeldAction.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -30286,9 +30040,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30304,26 +30058,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.NotFound.Body + public var body: Operations.DeclineAgentHeldAction.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.NotFound.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeclineAgentLogin.Output.NotFound) + case notFound(Operations.DeclineAgentHeldAction.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeclineAgentLogin.Output.NotFound { + public var notFound: Operations.DeclineAgentHeldAction.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -30337,9 +30091,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30355,26 +30109,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.MethodNotAllowed.Body + public var body: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeclineAgentLogin.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeclineAgentHeldAction.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeclineAgentLogin.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeclineAgentHeldAction.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -30388,9 +30142,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30406,26 +30160,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.Conflict.Body + public var body: Operations.DeclineAgentHeldAction.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.Conflict.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeclineAgentLogin.Output.Conflict) + case conflict(Operations.DeclineAgentHeldAction.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeclineAgentLogin.Output.Conflict { + public var conflict: Operations.DeclineAgentHeldAction.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -30439,9 +30193,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -30457,26 +30211,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.ContentTooLarge.Body + public var body: Operations.DeclineAgentHeldAction.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.ContentTooLarge.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeclineAgentLogin.Output.ContentTooLarge) + case contentTooLarge(Operations.DeclineAgentHeldAction.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeclineAgentLogin.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeclineAgentHeldAction.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -30490,9 +30244,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30508,26 +30262,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.InternalServerError.Body + public var body: Operations.DeclineAgentHeldAction.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.InternalServerError.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeclineAgentLogin.Output.InternalServerError) + case internalServerError(Operations.DeclineAgentHeldAction.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeclineAgentLogin.Output.InternalServerError { + public var internalServerError: Operations.DeclineAgentHeldAction.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -30541,9 +30295,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/held-actions/{actionId}/decline/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30559,26 +30313,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeclineAgentLogin.Output.ServiceUnavailable.Body + public var body: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeclineAgentLogin.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/held-actions/{actionId}/decline/post(declineAgentHeldAction)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeclineAgentLogin.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeclineAgentHeldAction.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeclineAgentLogin.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeclineAgentHeldAction.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -30628,92 +30382,62 @@ public enum Operations { } } } - /// Fills of the login's fields in the last 90 days, newest first. Page with `before` set to the last use's ID. + /// The logins the bot's desktop jobs can fill into web pages, and its requests for logins the owner has not answered. Values are never returned. /// - /// - Remark: HTTP `GET /v1/agents/{id}/logins/{name}/uses`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)`. - public enum ListAgentLoginUses { - public static let id: Swift.String = "listAgentLoginUses" + /// - Remark: HTTP `GET /v1/agents/{id}/logins`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)`. + public enum ListAgentLogins { + public static let id: Swift.String = "listAgentLogins" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/path/name`. - public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - name: - public init( - id: Swift.String, - name: Swift.String - ) { + public init(id: Swift.String) { self.id = id - self.name = name - } - } - public var path: Operations.ListAgentLoginUses.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/query/limit`. - public var limit: Swift.Int? - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/query/before`. - public var before: Swift.String? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - limit: - /// - before: - public init( - limit: Swift.Int? = nil, - before: Swift.String? = nil - ) { - self.limit = limit - self.before = before } } - public var query: Operations.ListAgentLoginUses.Input.Query - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/header`. + public var path: Operations.ListAgentLogins.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListAgentLoginUses.Input.Headers + public var headers: Operations.ListAgentLogins.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.ListAgentLoginUses.Input.Path, - query: Operations.ListAgentLoginUses.Input.Query = .init(), - headers: Operations.ListAgentLoginUses.Input.Headers = .init() + path: Operations.ListAgentLogins.Input.Path, + headers: Operations.ListAgentLogins.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/200/content/application\/json`. - case json([Components.Schemas.LoginUse]) + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Logins) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.LoginUse] { + public var json: Components.Schemas.Logins { get throws { switch self { case let .json(body): @@ -30723,26 +30447,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.Ok.Body + public var body: Operations.ListAgentLogins.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.Ok.Body) { + public init(body: Operations.ListAgentLogins.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListAgentLoginUses.Output.Ok) + case ok(Operations.ListAgentLogins.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListAgentLoginUses.Output.Ok { + public var ok: Operations.ListAgentLogins.Output.Ok { get throws { switch self { case let .ok(response): @@ -30756,9 +30480,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30774,26 +30498,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.BadRequest.Body + public var body: Operations.ListAgentLogins.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.BadRequest.Body) { + public init(body: Operations.ListAgentLogins.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListAgentLoginUses.Output.BadRequest) + case badRequest(Operations.ListAgentLogins.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListAgentLoginUses.Output.BadRequest { + public var badRequest: Operations.ListAgentLogins.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -30807,9 +30531,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -30825,26 +30549,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.Unauthorized.Body + public var body: Operations.ListAgentLogins.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.Unauthorized.Body) { + public init(body: Operations.ListAgentLogins.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListAgentLoginUses.Output.Unauthorized) + case unauthorized(Operations.ListAgentLogins.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListAgentLoginUses.Output.Unauthorized { + public var unauthorized: Operations.ListAgentLogins.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -30858,9 +30582,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30876,26 +30600,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.NotFound.Body + public var body: Operations.ListAgentLogins.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.NotFound.Body) { + public init(body: Operations.ListAgentLogins.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListAgentLoginUses.Output.NotFound) + case notFound(Operations.ListAgentLogins.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListAgentLoginUses.Output.NotFound { + public var notFound: Operations.ListAgentLogins.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -30909,9 +30633,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30927,26 +30651,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.MethodNotAllowed.Body + public var body: Operations.ListAgentLogins.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListAgentLogins.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListAgentLoginUses.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListAgentLogins.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListAgentLoginUses.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListAgentLogins.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -30960,9 +30684,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -30978,26 +30702,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.Conflict.Body + public var body: Operations.ListAgentLogins.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.Conflict.Body) { + public init(body: Operations.ListAgentLogins.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListAgentLoginUses.Output.Conflict) + case conflict(Operations.ListAgentLogins.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListAgentLoginUses.Output.Conflict { + public var conflict: Operations.ListAgentLogins.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -31011,9 +30735,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -31029,26 +30753,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.ContentTooLarge.Body + public var body: Operations.ListAgentLogins.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.ContentTooLarge.Body) { + public init(body: Operations.ListAgentLogins.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListAgentLoginUses.Output.ContentTooLarge) + case contentTooLarge(Operations.ListAgentLogins.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListAgentLoginUses.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListAgentLogins.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -31062,9 +30786,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31080,26 +30804,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.InternalServerError.Body + public var body: Operations.ListAgentLogins.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.InternalServerError.Body) { + public init(body: Operations.ListAgentLogins.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListAgentLoginUses.Output.InternalServerError) + case internalServerError(Operations.ListAgentLogins.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListAgentLoginUses.Output.InternalServerError { + public var internalServerError: Operations.ListAgentLogins.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -31113,9 +30837,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31131,26 +30855,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentLoginUses.Output.ServiceUnavailable.Body + public var body: Operations.ListAgentLogins.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentLoginUses.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListAgentLogins.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/get(listAgentLogins)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListAgentLoginUses.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListAgentLogins.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListAgentLoginUses.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListAgentLogins.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -31200,60 +30924,361 @@ public enum Operations { } } } - /// - Remark: HTTP `GET /v1/agents/{id}/memories`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)`. - public enum ListAgentMemories { - public static let id: Swift.String = "listAgentMemories" + /// Creates or updates a login. Saving one the bot requested answers the request and starts a bot turn with a notice. Each field is a value stored in Crumble or a password manager reference; a 1Password `item` fills every field. Every reference is read once to check it, and nothing is saved if one fails. + /// + /// - Remark: HTTP `PUT /v1/agents/{id}/logins/{name}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)`. + public enum SaveAgentLogin { + public static let id: Swift.String = "saveAgentLogin" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/path/id`. public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/path/name`. + public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - public init(id: Swift.String) { + /// - name: + public init( + id: Swift.String, + name: Swift.String + ) { self.id = id + self.name = name } } - public var path: Operations.ListAgentMemories.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/header`. + public var path: Operations.SaveAgentLogin.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListAgentMemories.Input.Headers + public var headers: Operations.SaveAgentLogin.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields`. + public struct FieldsPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code`. + public struct OneTimeCodePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference`. + public struct ReferencePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference/passwordManager`. + @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _1password = "1password" + case bitwarden = "bitwarden" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference/passwordManager`. + public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference/reference`. + public var reference: Swift.String + /// Creates a new `ReferencePayload`. + /// + /// - Parameters: + /// - passwordManager: + /// - reference: + public init( + passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload.PasswordManagerPayload, + reference: Swift.String + ) { + self.passwordManager = passwordManager + self.reference = reference + } + public enum CodingKeys: String, CodingKey { + case passwordManager + case reference + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/reference`. + public var reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code/value`. + public var value: Swift.String? + /// Creates a new `OneTimeCodePayload`. + /// + /// - Parameters: + /// - reference: + /// - value: + public init( + reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload? = nil, + value: Swift.String? = nil + ) { + self.reference = reference + self.value = value + } + public enum CodingKeys: String, CodingKey { + case reference + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.reference = try container.decodeIfPresent( + Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload.ReferencePayload.self, + forKey: .reference + ) + self.value = try container.decodeIfPresent( + Swift.String.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "reference", + "value" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/one_time_code`. + public var oneTimeCode: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password`. + public struct PasswordPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference`. + public struct ReferencePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference/passwordManager`. + @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _1password = "1password" + case bitwarden = "bitwarden" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference/passwordManager`. + public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference/reference`. + public var reference: Swift.String + /// Creates a new `ReferencePayload`. + /// + /// - Parameters: + /// - passwordManager: + /// - reference: + public init( + passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload.PasswordManagerPayload, + reference: Swift.String + ) { + self.passwordManager = passwordManager + self.reference = reference + } + public enum CodingKeys: String, CodingKey { + case passwordManager + case reference + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/reference`. + public var reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password/value`. + public var value: Swift.String? + /// Creates a new `PasswordPayload`. + /// + /// - Parameters: + /// - reference: + /// - value: + public init( + reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload? = nil, + value: Swift.String? = nil + ) { + self.reference = reference + self.value = value + } + public enum CodingKeys: String, CodingKey { + case reference + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.reference = try container.decodeIfPresent( + Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload.ReferencePayload.self, + forKey: .reference + ) + self.value = try container.decodeIfPresent( + Swift.String.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "reference", + "value" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/password`. + public var password: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username`. + public struct UsernamePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference`. + public struct ReferencePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference/passwordManager`. + @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _1password = "1password" + case bitwarden = "bitwarden" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference/passwordManager`. + public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference/reference`. + public var reference: Swift.String + /// Creates a new `ReferencePayload`. + /// + /// - Parameters: + /// - passwordManager: + /// - reference: + public init( + passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload.PasswordManagerPayload, + reference: Swift.String + ) { + self.passwordManager = passwordManager + self.reference = reference + } + public enum CodingKeys: String, CodingKey { + case passwordManager + case reference + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/reference`. + public var reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username/value`. + public var value: Swift.String? + /// Creates a new `UsernamePayload`. + /// + /// - Parameters: + /// - reference: + /// - value: + public init( + reference: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload? = nil, + value: Swift.String? = nil + ) { + self.reference = reference + self.value = value + } + public enum CodingKeys: String, CodingKey { + case reference + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.reference = try container.decodeIfPresent( + Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload.ReferencePayload.self, + forKey: .reference + ) + self.value = try container.decodeIfPresent( + Swift.String.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "reference", + "value" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields/username`. + public var username: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload? + /// Creates a new `FieldsPayload`. + /// + /// - Parameters: + /// - oneTimeCode: + /// - password: + /// - username: + public init( + oneTimeCode: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.OneTimeCodePayload? = nil, + password: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.PasswordPayload? = nil, + username: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload.UsernamePayload? = nil + ) { + self.oneTimeCode = oneTimeCode + self.password = password + self.username = username + } + public enum CodingKeys: String, CodingKey { + case oneTimeCode = "one_time_code" + case password + case username + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/fields`. + public var fields: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/hosts`. + public var hosts: [Swift.String]? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item`. + public struct ItemPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item/passwordManager`. + @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _1password = "1password" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item/passwordManager`. + public var passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item/reference`. + public var reference: Swift.String + /// Creates a new `ItemPayload`. + /// + /// - Parameters: + /// - passwordManager: + /// - reference: + public init( + passwordManager: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload.PasswordManagerPayload, + reference: Swift.String + ) { + self.passwordManager = passwordManager + self.reference = reference + } + public enum CodingKeys: String, CodingKey { + case passwordManager + case reference + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/json/item`. + public var item: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - fields: + /// - hosts: + /// - item: + public init( + fields: Operations.SaveAgentLogin.Input.Body.JsonPayload.FieldsPayload? = nil, + hosts: [Swift.String]? = nil, + item: Operations.SaveAgentLogin.Input.Body.JsonPayload.ItemPayload? = nil + ) { + self.fields = fields + self.hosts = hosts + self.item = item + } + public enum CodingKeys: String, CodingKey { + case fields + case hosts + case item + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/requestBody/content/application\/json`. + case json(Operations.SaveAgentLogin.Input.Body.JsonPayload) + } + public var body: Operations.SaveAgentLogin.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.ListAgentMemories.Input.Path, - headers: Operations.ListAgentMemories.Input.Headers = .init() + path: Operations.SaveAgentLogin.Input.Path, + headers: Operations.SaveAgentLogin.Input.Headers = .init(), + body: Operations.SaveAgentLogin.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Memory]) + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.Login) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Memory] { + public var json: Components.Schemas.Login { get throws { switch self { case let .json(body): @@ -31263,26 +31288,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.Ok.Body + public var body: Operations.SaveAgentLogin.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.Ok.Body) { + public init(body: Operations.SaveAgentLogin.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListAgentMemories.Output.Ok) + case ok(Operations.SaveAgentLogin.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListAgentMemories.Output.Ok { + public var ok: Operations.SaveAgentLogin.Output.Ok { get throws { switch self { case let .ok(response): @@ -31296,9 +31321,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31314,26 +31339,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.BadRequest.Body + public var body: Operations.SaveAgentLogin.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.BadRequest.Body) { + public init(body: Operations.SaveAgentLogin.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListAgentMemories.Output.BadRequest) + case badRequest(Operations.SaveAgentLogin.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListAgentMemories.Output.BadRequest { + public var badRequest: Operations.SaveAgentLogin.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -31347,9 +31372,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -31365,26 +31390,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.Unauthorized.Body + public var body: Operations.SaveAgentLogin.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.Unauthorized.Body) { + public init(body: Operations.SaveAgentLogin.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListAgentMemories.Output.Unauthorized) + case unauthorized(Operations.SaveAgentLogin.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListAgentMemories.Output.Unauthorized { + public var unauthorized: Operations.SaveAgentLogin.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -31398,9 +31423,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31416,26 +31441,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.NotFound.Body + public var body: Operations.SaveAgentLogin.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.NotFound.Body) { + public init(body: Operations.SaveAgentLogin.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListAgentMemories.Output.NotFound) + case notFound(Operations.SaveAgentLogin.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListAgentMemories.Output.NotFound { + public var notFound: Operations.SaveAgentLogin.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -31449,9 +31474,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31467,26 +31492,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.MethodNotAllowed.Body + public var body: Operations.SaveAgentLogin.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.MethodNotAllowed.Body) { + public init(body: Operations.SaveAgentLogin.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListAgentMemories.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SaveAgentLogin.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListAgentMemories.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SaveAgentLogin.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -31500,9 +31525,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31518,26 +31543,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.Conflict.Body + public var body: Operations.SaveAgentLogin.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.Conflict.Body) { + public init(body: Operations.SaveAgentLogin.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListAgentMemories.Output.Conflict) + case conflict(Operations.SaveAgentLogin.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListAgentMemories.Output.Conflict { + public var conflict: Operations.SaveAgentLogin.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -31551,9 +31576,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -31569,26 +31594,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.ContentTooLarge.Body + public var body: Operations.SaveAgentLogin.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.ContentTooLarge.Body) { + public init(body: Operations.SaveAgentLogin.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListAgentMemories.Output.ContentTooLarge) + case contentTooLarge(Operations.SaveAgentLogin.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListAgentMemories.Output.ContentTooLarge { + public var contentTooLarge: Operations.SaveAgentLogin.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -31602,9 +31627,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31620,26 +31645,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.InternalServerError.Body + public var body: Operations.SaveAgentLogin.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.InternalServerError.Body) { + public init(body: Operations.SaveAgentLogin.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListAgentMemories.Output.InternalServerError) + case internalServerError(Operations.SaveAgentLogin.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListAgentMemories.Output.InternalServerError { + public var internalServerError: Operations.SaveAgentLogin.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -31653,9 +31678,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31671,26 +31696,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentMemories.Output.ServiceUnavailable.Body + public var body: Operations.SaveAgentLogin.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentMemories.Output.ServiceUnavailable.Body) { + public init(body: Operations.SaveAgentLogin.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/put(saveAgentLogin)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListAgentMemories.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SaveAgentLogin.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListAgentMemories.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SaveAgentLogin.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -31740,129 +31765,98 @@ public enum Operations { } } } - /// - Remark: HTTP `POST /v1/agents/{id}/memories`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)`. - public enum CreateAgentMemory { - public static let id: Swift.String = "createAgentMemory" + /// Deletes a login and its fill records, or declines a request for one, which starts a bot turn with a notice. + /// + /// - Remark: HTTP `DELETE /v1/agents/{id}/logins/{name}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)`. + public enum DeleteAgentLogin { + public static let id: Swift.String = "deleteAgentLogin" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/path/id`. public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/path/name`. + public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - public init(id: Swift.String) { + /// - name: + public init( + id: Swift.String, + name: Swift.String + ) { self.id = id + self.name = name } } - public var path: Operations.CreateAgentMemory.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/header`. + public var path: Operations.DeleteAgentLogin.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CreateAgentMemory.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody/json/content`. - public var content: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - content: - public init(content: Swift.String) { - self.content = content - } - public enum CodingKeys: String, CodingKey { - case content - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody/content/application\/json`. - case json(Operations.CreateAgentMemory.Input.Body.JsonPayload) - } - public var body: Operations.CreateAgentMemory.Input.Body + public var headers: Operations.DeleteAgentLogin.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CreateAgentMemory.Input.Path, - headers: Operations.CreateAgentMemory.Input.Headers = .init(), - body: Operations.CreateAgentMemory.Input.Body + path: Operations.DeleteAgentLogin.Input.Path, + headers: Operations.DeleteAgentLogin.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/201/content/application\/json`. - case json(Components.Schemas.Memory) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Memory { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.Created.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/201`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/204`. /// - /// HTTP response code: `201 created`. - case created(Operations.CreateAgentMemory.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteAgentLogin.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.CreateAgentMemory.Output.Created { + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteAgentLogin.Output.NoContent { get throws { switch self { - case let .created(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31878,26 +31872,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.BadRequest.Body + public var body: Operations.DeleteAgentLogin.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.BadRequest.Body) { + public init(body: Operations.DeleteAgentLogin.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CreateAgentMemory.Output.BadRequest) + case badRequest(Operations.DeleteAgentLogin.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CreateAgentMemory.Output.BadRequest { + public var badRequest: Operations.DeleteAgentLogin.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -31911,9 +31905,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -31929,26 +31923,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.Unauthorized.Body + public var body: Operations.DeleteAgentLogin.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.Unauthorized.Body) { + public init(body: Operations.DeleteAgentLogin.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CreateAgentMemory.Output.Unauthorized) + case unauthorized(Operations.DeleteAgentLogin.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CreateAgentMemory.Output.Unauthorized { + public var unauthorized: Operations.DeleteAgentLogin.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -31962,9 +31956,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -31980,26 +31974,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.NotFound.Body + public var body: Operations.DeleteAgentLogin.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.NotFound.Body) { + public init(body: Operations.DeleteAgentLogin.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CreateAgentMemory.Output.NotFound) + case notFound(Operations.DeleteAgentLogin.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CreateAgentMemory.Output.NotFound { + public var notFound: Operations.DeleteAgentLogin.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -32013,9 +32007,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32031,26 +32025,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.MethodNotAllowed.Body + public var body: Operations.DeleteAgentLogin.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteAgentLogin.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CreateAgentMemory.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteAgentLogin.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CreateAgentMemory.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteAgentLogin.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -32064,9 +32058,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32082,26 +32076,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.Conflict.Body + public var body: Operations.DeleteAgentLogin.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.Conflict.Body) { + public init(body: Operations.DeleteAgentLogin.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CreateAgentMemory.Output.Conflict) + case conflict(Operations.DeleteAgentLogin.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CreateAgentMemory.Output.Conflict { + public var conflict: Operations.DeleteAgentLogin.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -32115,9 +32109,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -32133,26 +32127,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.ContentTooLarge.Body + public var body: Operations.DeleteAgentLogin.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteAgentLogin.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CreateAgentMemory.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteAgentLogin.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CreateAgentMemory.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteAgentLogin.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -32166,9 +32160,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32184,26 +32178,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.InternalServerError.Body + public var body: Operations.DeleteAgentLogin.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.InternalServerError.Body) { + public init(body: Operations.DeleteAgentLogin.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CreateAgentMemory.Output.InternalServerError) + case internalServerError(Operations.DeleteAgentLogin.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CreateAgentMemory.Output.InternalServerError { + public var internalServerError: Operations.DeleteAgentLogin.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -32217,9 +32211,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32235,26 +32229,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentMemory.Output.ServiceUnavailable.Body + public var body: Operations.DeleteAgentLogin.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentMemory.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteAgentLogin.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/delete(deleteAgentLogin)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CreateAgentMemory.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteAgentLogin.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CreateAgentMemory.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteAgentLogin.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -32304,244 +32298,98 @@ public enum Operations { } } } - /// - Remark: HTTP `PATCH /v1/agents/{id}/memories/{memoryId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)`. - public enum UpdateAgentMemory { - public static let id: Swift.String = "updateAgentMemory" + /// Declines a pending login request without changing a saved login. + /// + /// - Remark: HTTP `POST /v1/agents/{id}/logins/{name}/decline`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)`. + public enum DeclineAgentLogin { + public static let id: Swift.String = "declineAgentLogin" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/path/memoryId`. - public var memoryId: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/path/name`. + public var name: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - memoryId: + /// - name: public init( id: Swift.String, - memoryId: Swift.String + name: Swift.String ) { self.id = id - self.memoryId = memoryId + self.name = name } } - public var path: Operations.UpdateAgentMemory.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/header`. + public var path: Operations.DeclineAgentLogin.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.UpdateAgentMemory.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody/json/content`. - public var content: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - content: - public init(content: Swift.String) { - self.content = content - } - public enum CodingKeys: String, CodingKey { - case content - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody/content/application\/json`. - case json(Operations.UpdateAgentMemory.Input.Body.JsonPayload) - } - public var body: Operations.UpdateAgentMemory.Input.Body + public var headers: Operations.DeclineAgentLogin.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.UpdateAgentMemory.Input.Path, - headers: Operations.UpdateAgentMemory.Input.Headers = .init(), - body: Operations.UpdateAgentMemory.Input.Body + path: Operations.DeclineAgentLogin.Input.Path, + headers: Operations.DeclineAgentLogin.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/agentId`. - public var agentId: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/content`. - public var content: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/createdAt`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/id`. - public var id: Swift.String - /// Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat. - /// - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source`. - public struct SourcePayload: Codable, Hashable, Sendable { - /// For `bot`. - /// - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/agentId`. - public var agentId: Swift.String? - /// For `group`. - /// - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/groupId`. - public var groupId: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/kind`. - @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { - case chat = "chat" - case owner = "owner" - case task = "task" - case bot = "bot" - case group = "group" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/kind`. - public var kind: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload.KindPayload - /// The task, bot, or group chat, as named when the memory was saved. - /// - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/name`. - public var name: Swift.String? - /// For `task`. - /// - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/scheduleId`. - public var scheduleId: Swift.String? - /// Creates a new `SourcePayload`. - /// - /// - Parameters: - /// - agentId: For `bot`. - /// - groupId: For `group`. - /// - kind: - /// - name: The task, bot, or group chat, as named when the memory was saved. - /// - scheduleId: For `task`. - public init( - agentId: Swift.String? = nil, - groupId: Swift.String? = nil, - kind: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload.KindPayload, - name: Swift.String? = nil, - scheduleId: Swift.String? = nil - ) { - self.agentId = agentId - self.groupId = groupId - self.kind = kind - self.name = name - self.scheduleId = scheduleId - } - public enum CodingKeys: String, CodingKey { - case agentId - case groupId - case kind - case name - case scheduleId - } - } - /// Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat. - /// - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source`. - public var source: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/updatedAt`. - public var updatedAt: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - agentId: - /// - content: - /// - createdAt: - /// - id: - /// - source: Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat. - /// - updatedAt: - public init( - agentId: Swift.String? = nil, - content: Swift.String, - createdAt: Swift.String, - id: Swift.String, - source: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload? = nil, - updatedAt: Swift.String - ) { - self.agentId = agentId - self.content = content - self.createdAt = createdAt - self.id = id - self.source = source - self.updatedAt = updatedAt - } - public enum CodingKeys: String, CodingKey { - case agentId - case content - case createdAt - case id - case source - case updatedAt - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/application\/json`. - case json(Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload?) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload? { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/200`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateAgentMemory.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeclineAgentLogin.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateAgentMemory.Output.Ok { + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeclineAgentLogin.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32557,26 +32405,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.BadRequest.Body + public var body: Operations.DeclineAgentLogin.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.BadRequest.Body) { + public init(body: Operations.DeclineAgentLogin.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.UpdateAgentMemory.Output.BadRequest) + case badRequest(Operations.DeclineAgentLogin.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.UpdateAgentMemory.Output.BadRequest { + public var badRequest: Operations.DeclineAgentLogin.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -32590,9 +32438,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -32608,26 +32456,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.Unauthorized.Body + public var body: Operations.DeclineAgentLogin.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.Unauthorized.Body) { + public init(body: Operations.DeclineAgentLogin.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.UpdateAgentMemory.Output.Unauthorized) + case unauthorized(Operations.DeclineAgentLogin.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.UpdateAgentMemory.Output.Unauthorized { + public var unauthorized: Operations.DeclineAgentLogin.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -32641,9 +32489,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32659,26 +32507,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.NotFound.Body + public var body: Operations.DeclineAgentLogin.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.NotFound.Body) { + public init(body: Operations.DeclineAgentLogin.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.UpdateAgentMemory.Output.NotFound) + case notFound(Operations.DeclineAgentLogin.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.UpdateAgentMemory.Output.NotFound { + public var notFound: Operations.DeclineAgentLogin.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -32692,9 +32540,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32710,26 +32558,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.MethodNotAllowed.Body + public var body: Operations.DeclineAgentLogin.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeclineAgentLogin.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.UpdateAgentMemory.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeclineAgentLogin.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.UpdateAgentMemory.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeclineAgentLogin.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -32743,9 +32591,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32761,26 +32609,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.Conflict.Body + public var body: Operations.DeclineAgentLogin.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.Conflict.Body) { + public init(body: Operations.DeclineAgentLogin.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.UpdateAgentMemory.Output.Conflict) + case conflict(Operations.DeclineAgentLogin.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.UpdateAgentMemory.Output.Conflict { + public var conflict: Operations.DeclineAgentLogin.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -32794,9 +32642,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -32812,26 +32660,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.ContentTooLarge.Body + public var body: Operations.DeclineAgentLogin.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.ContentTooLarge.Body) { + public init(body: Operations.DeclineAgentLogin.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.UpdateAgentMemory.Output.ContentTooLarge) + case contentTooLarge(Operations.DeclineAgentLogin.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.UpdateAgentMemory.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeclineAgentLogin.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -32845,9 +32693,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32863,26 +32711,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.InternalServerError.Body + public var body: Operations.DeclineAgentLogin.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.InternalServerError.Body) { + public init(body: Operations.DeclineAgentLogin.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.UpdateAgentMemory.Output.InternalServerError) + case internalServerError(Operations.DeclineAgentLogin.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.UpdateAgentMemory.Output.InternalServerError { + public var internalServerError: Operations.DeclineAgentLogin.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -32896,9 +32744,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/decline/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -32914,12 +32762,2367 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentMemory.Output.ServiceUnavailable.Body + public var body: Operations.DeclineAgentLogin.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentMemory.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeclineAgentLogin.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/decline/post(declineAgentLogin)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.DeclineAgentLogin.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.DeclineAgentLogin.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// Fills of the login's fields in the last 90 days, newest first. Page with `before` set to the last use's ID. + /// + /// - Remark: HTTP `GET /v1/agents/{id}/logins/{name}/uses`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)`. + public enum ListAgentLoginUses { + public static let id: Swift.String = "listAgentLoginUses" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/path/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/path/name`. + public var name: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + /// - name: + public init( + id: Swift.String, + name: Swift.String + ) { + self.id = id + self.name = name + } + } + public var path: Operations.ListAgentLoginUses.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/query/limit`. + public var limit: Swift.Int? + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/query/before`. + public var before: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - limit: + /// - before: + public init( + limit: Swift.Int? = nil, + before: Swift.String? = nil + ) { + self.limit = limit + self.before = before + } + } + public var query: Operations.ListAgentLoginUses.Input.Query + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ListAgentLoginUses.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ListAgentLoginUses.Input.Path, + query: Operations.ListAgentLoginUses.Input.Query = .init(), + headers: Operations.ListAgentLoginUses.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/200/content/application\/json`. + case json([Components.Schemas.LoginUse]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.LoginUse] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ListAgentLoginUses.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListAgentLoginUses.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.ListAgentLoginUses.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.ListAgentLoginUses.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.ListAgentLoginUses.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.ListAgentLoginUses.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ListAgentLoginUses.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ListAgentLoginUses.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.ListAgentLoginUses.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.ListAgentLoginUses.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ListAgentLoginUses.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ListAgentLoginUses.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.ListAgentLoginUses.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.ListAgentLoginUses.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.ListAgentLoginUses.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.ListAgentLoginUses.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/logins/{name}/uses/GET/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentLoginUses.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentLoginUses.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/logins/{name}/uses/get(listAgentLoginUses)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ListAgentLoginUses.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ListAgentLoginUses.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// - Remark: HTTP `GET /v1/agents/{id}/memories`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)`. + public enum ListAgentMemories { + public static let id: Swift.String = "listAgentMemories" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.ListAgentMemories.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ListAgentMemories.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ListAgentMemories.Input.Path, + headers: Operations.ListAgentMemories.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Memory]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.Memory] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ListAgentMemories.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListAgentMemories.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.ListAgentMemories.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.ListAgentMemories.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.ListAgentMemories.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.ListAgentMemories.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ListAgentMemories.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ListAgentMemories.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.ListAgentMemories.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.ListAgentMemories.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ListAgentMemories.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ListAgentMemories.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.ListAgentMemories.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.ListAgentMemories.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.ListAgentMemories.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.ListAgentMemories.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/GET/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentMemories.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentMemories.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/get(listAgentMemories)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ListAgentMemories.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ListAgentMemories.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// - Remark: HTTP `POST /v1/agents/{id}/memories`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)`. + public enum CreateAgentMemory { + public static let id: Swift.String = "createAgentMemory" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.CreateAgentMemory.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CreateAgentMemory.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody/json/content`. + public var content: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - content: + public init(content: Swift.String) { + self.content = content + } + public enum CodingKeys: String, CodingKey { + case content + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/requestBody/content/application\/json`. + case json(Operations.CreateAgentMemory.Input.Body.JsonPayload) + } + public var body: Operations.CreateAgentMemory.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CreateAgentMemory.Input.Path, + headers: Operations.CreateAgentMemory.Input.Headers = .init(), + body: Operations.CreateAgentMemory.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/201/content/application\/json`. + case json(Components.Schemas.Memory) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Memory { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.Created.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.CreateAgentMemory.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CreateAgentMemory.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.CreateAgentMemory.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.CreateAgentMemory.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.CreateAgentMemory.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.CreateAgentMemory.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.CreateAgentMemory.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.CreateAgentMemory.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.CreateAgentMemory.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.CreateAgentMemory.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.CreateAgentMemory.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.CreateAgentMemory.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.CreateAgentMemory.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.CreateAgentMemory.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.CreateAgentMemory.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.CreateAgentMemory.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/POST/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentMemory.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentMemory.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/post(createAgentMemory)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.CreateAgentMemory.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.CreateAgentMemory.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// - Remark: HTTP `PATCH /v1/agents/{id}/memories/{memoryId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)`. + public enum UpdateAgentMemory { + public static let id: Swift.String = "updateAgentMemory" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/path/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/path/memoryId`. + public var memoryId: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + /// - memoryId: + public init( + id: Swift.String, + memoryId: Swift.String + ) { + self.id = id + self.memoryId = memoryId + } + } + public var path: Operations.UpdateAgentMemory.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UpdateAgentMemory.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody/json/content`. + public var content: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - content: + public init(content: Swift.String) { + self.content = content + } + public enum CodingKeys: String, CodingKey { + case content + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/requestBody/content/application\/json`. + case json(Operations.UpdateAgentMemory.Input.Body.JsonPayload) + } + public var body: Operations.UpdateAgentMemory.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.UpdateAgentMemory.Input.Path, + headers: Operations.UpdateAgentMemory.Input.Headers = .init(), + body: Operations.UpdateAgentMemory.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/agentId`. + public var agentId: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/content`. + public var content: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/createdAt`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/id`. + public var id: Swift.String + /// Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat. + /// + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source`. + public struct SourcePayload: Codable, Hashable, Sendable { + /// For `bot`. + /// + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/agentId`. + public var agentId: Swift.String? + /// For `group`. + /// + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/groupId`. + public var groupId: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case chat = "chat" + case owner = "owner" + case task = "task" + case bot = "bot" + case group = "group" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/kind`. + public var kind: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload.KindPayload + /// The task, bot, or group chat, as named when the memory was saved. + /// + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/name`. + public var name: Swift.String? + /// For `task`. + /// + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source/scheduleId`. + public var scheduleId: Swift.String? + /// Creates a new `SourcePayload`. + /// + /// - Parameters: + /// - agentId: For `bot`. + /// - groupId: For `group`. + /// - kind: + /// - name: The task, bot, or group chat, as named when the memory was saved. + /// - scheduleId: For `task`. + public init( + agentId: Swift.String? = nil, + groupId: Swift.String? = nil, + kind: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload.KindPayload, + name: Swift.String? = nil, + scheduleId: Swift.String? = nil + ) { + self.agentId = agentId + self.groupId = groupId + self.kind = kind + self.name = name + self.scheduleId = scheduleId + } + public enum CodingKeys: String, CodingKey { + case agentId + case groupId + case kind + case name + case scheduleId + } + } + /// Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat. + /// + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/source`. + public var source: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/json/updatedAt`. + public var updatedAt: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - agentId: + /// - content: + /// - createdAt: + /// - id: + /// - source: Where the memory was saved: the owner's bot chat, the owner directly, a scheduled task, another bot's request, or a group chat. + /// - updatedAt: + public init( + agentId: Swift.String? = nil, + content: Swift.String, + createdAt: Swift.String, + id: Swift.String, + source: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload.SourcePayload? = nil, + updatedAt: Swift.String + ) { + self.agentId = agentId + self.content = content + self.createdAt = createdAt + self.id = id + self.source = source + self.updatedAt = updatedAt + } + public enum CodingKeys: String, CodingKey { + case agentId + case content + case createdAt + case id + case source + case updatedAt + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/200/content/application\/json`. + case json(Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload?) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.UpdateAgentMemory.Output.Ok.Body.JsonPayload? { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.UpdateAgentMemory.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UpdateAgentMemory.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.UpdateAgentMemory.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.UpdateAgentMemory.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.UpdateAgentMemory.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.UpdateAgentMemory.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.UpdateAgentMemory.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.UpdateAgentMemory.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.UpdateAgentMemory.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.UpdateAgentMemory.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.UpdateAgentMemory.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.UpdateAgentMemory.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.UpdateAgentMemory.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.UpdateAgentMemory.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.UpdateAgentMemory.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.UpdateAgentMemory.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/PATCH/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.UpdateAgentMemory.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentMemory.Output.ServiceUnavailable.Body) { self.body = body } } @@ -32928,12 +35131,2872 @@ public enum Operations { /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/patch(updateAgentMemory)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.UpdateAgentMemory.Output.ServiceUnavailable) + case serviceUnavailable(Operations.UpdateAgentMemory.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.UpdateAgentMemory.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// - Remark: HTTP `DELETE /v1/agents/{id}/memories/{memoryId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)`. + public enum DeleteAgentMemory { + public static let id: Swift.String = "deleteAgentMemory" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/path/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/path/memoryId`. + public var memoryId: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + /// - memoryId: + public init( + id: Swift.String, + memoryId: Swift.String + ) { + self.id = id + self.memoryId = memoryId + } + } + public var path: Operations.DeleteAgentMemory.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.DeleteAgentMemory.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.DeleteAgentMemory.Input.Path, + headers: Operations.DeleteAgentMemory.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} + } + /// Success, no response body + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteAgentMemory.Output.NoContent) + /// Success, no response body + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteAgentMemory.Output.NoContent { + get throws { + switch self { + case let .noContent(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "noContent", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.DeleteAgentMemory.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.DeleteAgentMemory.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.DeleteAgentMemory.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.DeleteAgentMemory.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.DeleteAgentMemory.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.DeleteAgentMemory.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.DeleteAgentMemory.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.DeleteAgentMemory.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.DeleteAgentMemory.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.DeleteAgentMemory.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.DeleteAgentMemory.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.DeleteAgentMemory.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.DeleteAgentMemory.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.DeleteAgentMemory.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.DeleteAgentMemory.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.DeleteAgentMemory.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.DeleteAgentMemory.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.DeleteAgentMemory.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// - Remark: HTTP `POST /v1/agents/{id}/messages`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)`. + public enum SendMessage { + public static let id: Swift.String = "sendMessage" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.SendMessage.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.SendMessage.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/content`. + public var content: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/files`. + public var files: [Swift.String]? + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/replyTo`. + public var replyTo: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/requestId`. + public var requestId: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/timezone`. + public var timezone: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - content: + /// - files: + /// - replyTo: + /// - requestId: + /// - timezone: + public init( + content: Swift.String, + files: [Swift.String]? = nil, + replyTo: Swift.String? = nil, + requestId: Swift.String, + timezone: Swift.String? = nil + ) { + self.content = content + self.files = files + self.replyTo = replyTo + self.requestId = requestId + self.timezone = timezone + } + public enum CodingKeys: String, CodingKey { + case content + case files + case replyTo + case requestId + case timezone + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.content = try container.decode( + Swift.String.self, + forKey: .content + ) + self.files = try container.decodeIfPresent( + [Swift.String].self, + forKey: .files + ) + self.replyTo = try container.decodeIfPresent( + Swift.String.self, + forKey: .replyTo + ) + self.requestId = try container.decode( + Swift.String.self, + forKey: .requestId + ) + self.timezone = try container.decodeIfPresent( + Swift.String.self, + forKey: .timezone + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "content", + "files", + "replyTo", + "requestId", + "timezone" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/content/application\/json`. + case json(Operations.SendMessage.Input.Body.JsonPayload) + } + public var body: Operations.SendMessage.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.SendMessage.Input.Path, + headers: Operations.SendMessage.Input.Headers = .init(), + body: Operations.SendMessage.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Accepted: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/202/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/202/content/application\/json`. + case json(Components.Schemas.Execution) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.Execution { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.Accepted.Body + /// Creates a new `Accepted`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.Accepted.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/202`. + /// + /// HTTP response code: `202 accepted`. + case accepted(Operations.SendMessage.Output.Accepted) + /// The associated value of the enum case if `self` is `.accepted`. + /// + /// - Throws: An error if `self` is not `.accepted`. + /// - SeeAlso: `.accepted`. + public var accepted: Operations.SendMessage.Output.Accepted { + get throws { + switch self { + case let .accepted(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "accepted", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.SendMessage.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.SendMessage.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.SendMessage.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.SendMessage.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.SendMessage.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.SendMessage.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.SendMessage.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.SendMessage.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.SendMessage.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.SendMessage.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.SendMessage.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.SendMessage.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.SendMessage.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.SendMessage.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.SendMessage.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.SendMessage.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.SendMessage.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.SendMessage.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// What the bot's reviews changed, newest first, one entry per reviewed execution with its changes. Clients show these as notices in the bot chat, also after reconnecting. + /// + /// - Remark: HTTP `GET /v1/agents/{id}/reviews`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)`. + public enum ListAgentReviews { + public static let id: Swift.String = "listAgentReviews" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.ListAgentReviews.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/query/limit`. + public var limit: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - limit: + public init(limit: Swift.Int? = nil) { + self.limit = limit + } + } + public var query: Operations.ListAgentReviews.Input.Query + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ListAgentReviews.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - query: + /// - headers: + public init( + path: Operations.ListAgentReviews.Input.Path, + query: Operations.ListAgentReviews.Input.Query = .init(), + headers: Operations.ListAgentReviews.Input.Headers = .init() + ) { + self.path = path + self.query = query + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/200/content/application\/json`. + case json([Components.Schemas.ReviewResult]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.ReviewResult] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ListAgentReviews.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListAgentReviews.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.ListAgentReviews.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.ListAgentReviews.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.ListAgentReviews.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.ListAgentReviews.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ListAgentReviews.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ListAgentReviews.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.ListAgentReviews.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.ListAgentReviews.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ListAgentReviews.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ListAgentReviews.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.ListAgentReviews.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.ListAgentReviews.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.ListAgentReviews.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.ListAgentReviews.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentReviews.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentReviews.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ListAgentReviews.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ListAgentReviews.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// The bot's own skill packages, including stale and archived ones. The agent's inline `skills` field lists the same skills by name and instructions. + /// + /// - Remark: HTTP `GET /v1/agents/{id}/skills`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)`. + public enum ListAgentSkills { + public static let id: Swift.String = "listAgentSkills" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.ListAgentSkills.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.ListAgentSkills.Input.Headers + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + public init( + path: Operations.ListAgentSkills.Input.Path, + headers: Operations.ListAgentSkills.Input.Headers = .init() + ) { + self.path = path + self.headers = headers + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/200/content/application\/json`. + case json([Components.Schemas.SkillPackage]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.SkillPackage] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.ListAgentSkills.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListAgentSkills.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.ListAgentSkills.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.ListAgentSkills.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.ListAgentSkills.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.ListAgentSkills.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.ListAgentSkills.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.ListAgentSkills.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.ListAgentSkills.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.ListAgentSkills.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.ListAgentSkills.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.ListAgentSkills.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.ListAgentSkills.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.ListAgentSkills.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.ListAgentSkills.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.ListAgentSkills.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListAgentSkills.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListAgentSkills.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.ListAgentSkills.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.ListAgentSkills.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// - Remark: HTTP `POST /v1/agents/{id}/skills`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)`. + public enum CreateAgentSkill { + public static let id: Swift.String = "createAgentSkill" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.CreateAgentSkill.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.CreateAgentSkill.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/DocumentsPayload`. + public struct DocumentsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/DocumentsPayload/content`. + public var content: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/DocumentsPayload/path`. + public var path: Swift.String + /// Creates a new `DocumentsPayloadPayload`. + /// + /// - Parameters: + /// - content: + /// - path: + public init( + content: Swift.String, + path: Swift.String + ) { + self.content = content + self.path = path + } + public enum CodingKeys: String, CodingKey { + case content + case path + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/documents`. + public typealias DocumentsPayload = [Operations.CreateAgentSkill.Input.Body.JsonPayload.DocumentsPayloadPayload] + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/documents`. + public var documents: Operations.CreateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/instructions`. + public var instructions: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/name`. + public var name: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - description: + /// - documents: + /// - instructions: + /// - name: + public init( + description: Swift.String? = nil, + documents: Operations.CreateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? = nil, + instructions: Swift.String, + name: Swift.String + ) { + self.description = description + self.documents = documents + self.instructions = instructions + self.name = name + } + public enum CodingKeys: String, CodingKey { + case description + case documents + case instructions + case name + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/content/application\/json`. + case json(Operations.CreateAgentSkill.Input.Body.JsonPayload) + } + public var body: Operations.CreateAgentSkill.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.CreateAgentSkill.Input.Path, + headers: Operations.CreateAgentSkill.Input.Headers = .init(), + body: Operations.CreateAgentSkill.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/201/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/201/content/application\/json`. + case json(Components.Schemas.SkillPackage) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SkillPackage { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.Created.Body + /// Creates a new `Created`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.Created.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/201`. + /// + /// HTTP response code: `201 created`. + case created(Operations.CreateAgentSkill.Output.Created) + /// The associated value of the enum case if `self` is `.created`. + /// + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CreateAgentSkill.Output.Created { + get throws { + switch self { + case let .created(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "created", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.CreateAgentSkill.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.CreateAgentSkill.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.CreateAgentSkill.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.CreateAgentSkill.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.CreateAgentSkill.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.CreateAgentSkill.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.CreateAgentSkill.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.CreateAgentSkill.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.CreateAgentSkill.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.CreateAgentSkill.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.CreateAgentSkill.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.CreateAgentSkill.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.CreateAgentSkill.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.CreateAgentSkill.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.CreateAgentSkill.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.CreateAgentSkill.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.CreateAgentSkill.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.UpdateAgentMemory.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.CreateAgentSkill.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -32983,96 +38046,319 @@ public enum Operations { } } } - /// - Remark: HTTP `DELETE /v1/agents/{id}/memories/{memoryId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)`. - public enum DeleteAgentMemory { - public static let id: Swift.String = "deleteAgentMemory" + /// Changes a skill's content, restores an archived skill by setting state to active, or pins it so the curator never marks it stale or archives it. + /// + /// - Remark: HTTP `PATCH /v1/agents/{id}/skills/{skillId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)`. + public enum UpdateAgentSkill { + public static let id: Swift.String = "updateAgentSkill" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/path/memoryId`. - public var memoryId: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/path/skillId`. + public var skillId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - memoryId: + /// - skillId: public init( id: Swift.String, - memoryId: Swift.String + skillId: Swift.String ) { self.id = id - self.memoryId = memoryId + self.skillId = skillId + } + } + public var path: Operations.UpdateAgentSkill.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.UpdateAgentSkill.Input.Headers + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/description`. + public var description: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/DocumentsPayload`. + public struct DocumentsPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/DocumentsPayload/content`. + public var content: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/DocumentsPayload/path`. + public var path: Swift.String + /// Creates a new `DocumentsPayloadPayload`. + /// + /// - Parameters: + /// - content: + /// - path: + public init( + content: Swift.String, + path: Swift.String + ) { + self.content = content + self.path = path + } + public enum CodingKeys: String, CodingKey { + case content + case path + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/documents`. + public typealias DocumentsPayload = [Operations.UpdateAgentSkill.Input.Body.JsonPayload.DocumentsPayloadPayload] + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/documents`. + public var documents: Operations.UpdateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/instructions`. + public var instructions: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/pinned`. + public var pinned: Swift.Bool? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case stale = "stale" + case archived = "archived" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/state`. + public var state: Operations.UpdateAgentSkill.Input.Body.JsonPayload.StatePayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - description: + /// - documents: + /// - instructions: + /// - name: + /// - pinned: + /// - state: + public init( + description: Swift.String? = nil, + documents: Operations.UpdateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? = nil, + instructions: Swift.String? = nil, + name: Swift.String? = nil, + pinned: Swift.Bool? = nil, + state: Operations.UpdateAgentSkill.Input.Body.JsonPayload.StatePayload? = nil + ) { + self.description = description + self.documents = documents + self.instructions = instructions + self.name = name + self.pinned = pinned + self.state = state + } + public enum CodingKeys: String, CodingKey { + case description + case documents + case instructions + case name + case pinned + case state + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/content/application\/json`. + case json(Operations.UpdateAgentSkill.Input.Body.JsonPayload) + } + public var body: Operations.UpdateAgentSkill.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - path: + /// - headers: + /// - body: + public init( + path: Operations.UpdateAgentSkill.Input.Path, + headers: Operations.UpdateAgentSkill.Input.Headers = .init(), + body: Operations.UpdateAgentSkill.Input.Body + ) { + self.path = path + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/agentId`. + public var agentId: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/copiedFromSkillId`. + public var copiedFromSkillId: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/createdAt`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/createdBy`. + @frozen public enum CreatedByPayload: String, Codable, Hashable, Sendable, CaseIterable { + case owner = "owner" + case bot = "bot" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/createdBy`. + public var createdBy: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.CreatedByPayload + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/description`. + public var description: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/documents`. + public var documents: [Components.Schemas.SkillDocument] + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/instructions`. + public var instructions: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/lastUsedAt`. + public var lastUsedAt: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/name`. + public var name: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/origin`. + public var origin: Components.Schemas.SkillOrigin? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/pinned`. + public var pinned: Swift.Bool + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/sourceExecutionId`. + public var sourceExecutionId: Swift.String? + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/state`. + @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { + case active = "active" + case stale = "stale" + case archived = "archived" + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/state`. + public var state: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.StatePayload + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/updatedAt`. + public var updatedAt: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/useCount`. + public var useCount: Swift.Int + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - agentId: + /// - copiedFromSkillId: + /// - createdAt: + /// - createdBy: + /// - description: + /// - documents: + /// - id: + /// - instructions: + /// - lastUsedAt: + /// - name: + /// - origin: + /// - pinned: + /// - sourceExecutionId: + /// - state: + /// - updatedAt: + /// - useCount: + public init( + agentId: Swift.String? = nil, + copiedFromSkillId: Swift.String? = nil, + createdAt: Swift.String, + createdBy: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.CreatedByPayload, + description: Swift.String, + documents: [Components.Schemas.SkillDocument], + id: Swift.String, + instructions: Swift.String, + lastUsedAt: Swift.String? = nil, + name: Swift.String, + origin: Components.Schemas.SkillOrigin? = nil, + pinned: Swift.Bool, + sourceExecutionId: Swift.String? = nil, + state: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.StatePayload, + updatedAt: Swift.String, + useCount: Swift.Int + ) { + self.agentId = agentId + self.copiedFromSkillId = copiedFromSkillId + self.createdAt = createdAt + self.createdBy = createdBy + self.description = description + self.documents = documents + self.id = id + self.instructions = instructions + self.lastUsedAt = lastUsedAt + self.name = name + self.origin = origin + self.pinned = pinned + self.sourceExecutionId = sourceExecutionId + self.state = state + self.updatedAt = updatedAt + self.useCount = useCount + } + public enum CodingKeys: String, CodingKey { + case agentId + case copiedFromSkillId + case createdAt + case createdBy + case description + case documents + case id + case instructions + case lastUsedAt + case name + case origin + case pinned + case sourceExecutionId + case state + case updatedAt + case useCount + } + } + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/application\/json`. + case json(Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload?) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload? { + get throws { + switch self { + case let .json(body): + return body + } + } + } } - } - public var path: Operations.DeleteAgentMemory.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. + /// Received HTTP response body + public var body: Operations.UpdateAgentSkill.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept + /// - body: Received HTTP response body + public init(body: Operations.UpdateAgentSkill.Output.Ok.Body) { + self.body = body } } - public var headers: Operations.DeleteAgentMemory.Input.Headers - /// Creates a new `Input`. - /// - /// - Parameters: - /// - path: - /// - headers: - public init( - path: Operations.DeleteAgentMemory.Input.Path, - headers: Operations.DeleteAgentMemory.Input.Headers = .init() - ) { - self.path = path - self.headers = headers - } - } - @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} - } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteAgentMemory.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/204`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.UpdateAgentSkill.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteAgentMemory.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.UpdateAgentSkill.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33088,26 +38374,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.BadRequest.Body + public var body: Operations.UpdateAgentSkill.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.BadRequest.Body) { + public init(body: Operations.UpdateAgentSkill.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteAgentMemory.Output.BadRequest) + case badRequest(Operations.UpdateAgentSkill.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteAgentMemory.Output.BadRequest { + public var badRequest: Operations.UpdateAgentSkill.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -33121,9 +38407,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -33139,26 +38425,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.Unauthorized.Body + public var body: Operations.UpdateAgentSkill.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.Unauthorized.Body) { + public init(body: Operations.UpdateAgentSkill.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteAgentMemory.Output.Unauthorized) + case unauthorized(Operations.UpdateAgentSkill.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteAgentMemory.Output.Unauthorized { + public var unauthorized: Operations.UpdateAgentSkill.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -33172,9 +38458,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33190,26 +38476,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.NotFound.Body + public var body: Operations.UpdateAgentSkill.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.NotFound.Body) { + public init(body: Operations.UpdateAgentSkill.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteAgentMemory.Output.NotFound) + case notFound(Operations.UpdateAgentSkill.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteAgentMemory.Output.NotFound { + public var notFound: Operations.UpdateAgentSkill.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -33223,9 +38509,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33241,26 +38527,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.MethodNotAllowed.Body + public var body: Operations.UpdateAgentSkill.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.MethodNotAllowed.Body) { + public init(body: Operations.UpdateAgentSkill.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteAgentMemory.Output.MethodNotAllowed) + case methodNotAllowed(Operations.UpdateAgentSkill.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteAgentMemory.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.UpdateAgentSkill.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -33274,9 +38560,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33292,26 +38578,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.Conflict.Body + public var body: Operations.UpdateAgentSkill.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.Conflict.Body) { + public init(body: Operations.UpdateAgentSkill.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteAgentMemory.Output.Conflict) + case conflict(Operations.UpdateAgentSkill.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteAgentMemory.Output.Conflict { + public var conflict: Operations.UpdateAgentSkill.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -33325,9 +38611,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -33343,26 +38629,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.ContentTooLarge.Body + public var body: Operations.UpdateAgentSkill.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.ContentTooLarge.Body) { + public init(body: Operations.UpdateAgentSkill.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteAgentMemory.Output.ContentTooLarge) + case contentTooLarge(Operations.UpdateAgentSkill.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteAgentMemory.Output.ContentTooLarge { + public var contentTooLarge: Operations.UpdateAgentSkill.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -33376,9 +38662,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33394,26 +38680,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.InternalServerError.Body + public var body: Operations.UpdateAgentSkill.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.InternalServerError.Body) { + public init(body: Operations.UpdateAgentSkill.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteAgentMemory.Output.InternalServerError) + case internalServerError(Operations.UpdateAgentSkill.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteAgentMemory.Output.InternalServerError { + public var internalServerError: Operations.UpdateAgentSkill.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -33427,9 +38713,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/memories/{memoryId}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33445,26 +38731,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentMemory.Output.ServiceUnavailable.Body + public var body: Operations.UpdateAgentSkill.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentMemory.Output.ServiceUnavailable.Body) { + public init(body: Operations.UpdateAgentSkill.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/memories/{memoryId}/delete(deleteAgentMemory)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteAgentMemory.Output.ServiceUnavailable) + case serviceUnavailable(Operations.UpdateAgentSkill.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteAgentMemory.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.UpdateAgentSkill.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -33514,186 +38800,96 @@ public enum Operations { } } } - /// - Remark: HTTP `POST /v1/agents/{id}/messages`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)`. - public enum SendMessage { - public static let id: Swift.String = "sendMessage" + /// - Remark: HTTP `DELETE /v1/agents/{id}/skills/{skillId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)`. + public enum DeleteAgentSkill { + public static let id: Swift.String = "deleteAgentSkill" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/path`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/path/id`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/path/id`. public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/path/skillId`. + public var skillId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - public init(id: Swift.String) { + /// - skillId: + public init( + id: Swift.String, + skillId: Swift.String + ) { self.id = id + self.skillId = skillId } } - public var path: Operations.SendMessage.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/header`. + public var path: Operations.DeleteAgentSkill.Input.Path + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SendMessage.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/AttachmentsPayload`. - public struct AttachmentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/AttachmentsPayload/data`. - public var data: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/AttachmentsPayload/mimeType`. - public var mimeType: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/AttachmentsPayload/name`. - public var name: Swift.String - /// Creates a new `AttachmentsPayloadPayload`. - /// - /// - Parameters: - /// - data: - /// - mimeType: - /// - name: - public init( - data: Swift.String, - mimeType: Swift.String, - name: Swift.String - ) { - self.data = data - self.mimeType = mimeType - self.name = name - } - public enum CodingKeys: String, CodingKey { - case data - case mimeType - case name - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/attachments`. - public typealias AttachmentsPayload = [Operations.SendMessage.Input.Body.JsonPayload.AttachmentsPayloadPayload] - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/attachments`. - public var attachments: Operations.SendMessage.Input.Body.JsonPayload.AttachmentsPayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/content`. - public var content: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/replyTo`. - public var replyTo: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/requestId`. - public var requestId: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/json/timezone`. - public var timezone: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - attachments: - /// - content: - /// - replyTo: - /// - requestId: - /// - timezone: - public init( - attachments: Operations.SendMessage.Input.Body.JsonPayload.AttachmentsPayload? = nil, - content: Swift.String, - replyTo: Swift.String? = nil, - requestId: Swift.String, - timezone: Swift.String? = nil - ) { - self.attachments = attachments - self.content = content - self.replyTo = replyTo - self.requestId = requestId - self.timezone = timezone - } - public enum CodingKeys: String, CodingKey { - case attachments - case content - case replyTo - case requestId - case timezone - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/requestBody/content/application\/json`. - case json(Operations.SendMessage.Input.Body.JsonPayload) - } - public var body: Operations.SendMessage.Input.Body + public var headers: Operations.DeleteAgentSkill.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.SendMessage.Input.Path, - headers: Operations.SendMessage.Input.Headers = .init(), - body: Operations.SendMessage.Input.Body + path: Operations.DeleteAgentSkill.Input.Path, + headers: Operations.DeleteAgentSkill.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Accepted: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/202/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/202/content/application\/json`. - case json(Components.Schemas.Execution) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.Execution { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.SendMessage.Output.Accepted.Body - /// Creates a new `Accepted`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.Accepted.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/202`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/204`. /// - /// HTTP response code: `202 accepted`. - case accepted(Operations.SendMessage.Output.Accepted) - /// The associated value of the enum case if `self` is `.accepted`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteAgentSkill.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.accepted`. - /// - SeeAlso: `.accepted`. - public var accepted: Operations.SendMessage.Output.Accepted { + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteAgentSkill.Output.NoContent { get throws { switch self { - case let .accepted(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "accepted", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33709,26 +38905,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.BadRequest.Body + public var body: Operations.DeleteAgentSkill.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.BadRequest.Body) { + public init(body: Operations.DeleteAgentSkill.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/400`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SendMessage.Output.BadRequest) + case badRequest(Operations.DeleteAgentSkill.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SendMessage.Output.BadRequest { + public var badRequest: Operations.DeleteAgentSkill.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -33742,9 +38938,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -33760,26 +38956,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.Unauthorized.Body + public var body: Operations.DeleteAgentSkill.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.Unauthorized.Body) { + public init(body: Operations.DeleteAgentSkill.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/401`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SendMessage.Output.Unauthorized) + case unauthorized(Operations.DeleteAgentSkill.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SendMessage.Output.Unauthorized { + public var unauthorized: Operations.DeleteAgentSkill.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -33793,9 +38989,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33811,26 +39007,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.NotFound.Body + public var body: Operations.DeleteAgentSkill.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.NotFound.Body) { + public init(body: Operations.DeleteAgentSkill.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/404`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SendMessage.Output.NotFound) + case notFound(Operations.DeleteAgentSkill.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SendMessage.Output.NotFound { + public var notFound: Operations.DeleteAgentSkill.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -33844,9 +39040,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33862,26 +39058,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.MethodNotAllowed.Body + public var body: Operations.DeleteAgentSkill.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteAgentSkill.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/405`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SendMessage.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteAgentSkill.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SendMessage.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteAgentSkill.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -33895,9 +39091,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -33913,26 +39109,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.Conflict.Body + public var body: Operations.DeleteAgentSkill.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.Conflict.Body) { + public init(body: Operations.DeleteAgentSkill.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/409`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SendMessage.Output.Conflict) + case conflict(Operations.DeleteAgentSkill.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SendMessage.Output.Conflict { + public var conflict: Operations.DeleteAgentSkill.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -33946,9 +39142,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -33964,26 +39160,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.ContentTooLarge.Body + public var body: Operations.DeleteAgentSkill.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteAgentSkill.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/413`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SendMessage.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteAgentSkill.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SendMessage.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteAgentSkill.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -33997,9 +39193,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34015,26 +39211,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.InternalServerError.Body + public var body: Operations.DeleteAgentSkill.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.InternalServerError.Body) { + public init(body: Operations.DeleteAgentSkill.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/500`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SendMessage.Output.InternalServerError) + case internalServerError(Operations.DeleteAgentSkill.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SendMessage.Output.InternalServerError { + public var internalServerError: Operations.DeleteAgentSkill.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -34048,9 +39244,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/messages/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34066,26 +39262,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SendMessage.Output.ServiceUnavailable.Body + public var body: Operations.DeleteAgentSkill.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SendMessage.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteAgentSkill.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/messages/post(sendMessage)/responses/503`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SendMessage.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteAgentSkill.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SendMessage.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteAgentSkill.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -34118,95 +39314,59 @@ public enum Operations { } } public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .plainText: - return "text/plain" - } - } - public static var allCases: [Self] { - [ - .json, - .plainText - ] - } - } - } - /// What the bot's reviews changed, newest first, one entry per reviewed execution with its changes. Clients show these as notices in the bot chat, also after reconnecting. - /// - /// - Remark: HTTP `GET /v1/agents/{id}/reviews`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)`. - public enum ListAgentReviews { - public static let id: Swift.String = "listAgentReviews" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" } } - public var path: Operations.ListAgentReviews.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/query/limit`. - public var limit: Swift.Int? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - limit: - public init(limit: Swift.Int? = nil) { - self.limit = limit - } + public static var allCases: [Self] { + [ + .json, + .plainText + ] } - public var query: Operations.ListAgentReviews.Input.Query - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/header`. + } + } + /// - Remark: HTTP `GET /v1/capabilities`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)`. + public enum GetCapabilities { + public static let id: Swift.String = "getCapabilities" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/capabilities/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListAgentReviews.Input.Headers + public var headers: Operations.GetCapabilities.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: - /// - query: /// - headers: - public init( - path: Operations.ListAgentReviews.Input.Path, - query: Operations.ListAgentReviews.Input.Query = .init(), - headers: Operations.ListAgentReviews.Input.Headers = .init() - ) { - self.path = path - self.query = query + public init(headers: Operations.GetCapabilities.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/200/content/application\/json`. - case json([Components.Schemas.ReviewResult]) + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/200/content/application\/json`. + case json(Components.Schemas.Capabilities) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.ReviewResult] { + public var json: Components.Schemas.Capabilities { get throws { switch self { case let .json(body): @@ -34216,26 +39376,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.Ok.Body + public var body: Operations.GetCapabilities.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.Ok.Body) { + public init(body: Operations.GetCapabilities.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/200`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListAgentReviews.Output.Ok) + case ok(Operations.GetCapabilities.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListAgentReviews.Output.Ok { + public var ok: Operations.GetCapabilities.Output.Ok { get throws { switch self { case let .ok(response): @@ -34249,9 +39409,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34267,26 +39427,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.BadRequest.Body + public var body: Operations.GetCapabilities.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.BadRequest.Body) { + public init(body: Operations.GetCapabilities.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/400`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListAgentReviews.Output.BadRequest) + case badRequest(Operations.GetCapabilities.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListAgentReviews.Output.BadRequest { + public var badRequest: Operations.GetCapabilities.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -34300,9 +39460,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -34318,26 +39478,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.Unauthorized.Body + public var body: Operations.GetCapabilities.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.Unauthorized.Body) { + public init(body: Operations.GetCapabilities.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/401`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListAgentReviews.Output.Unauthorized) + case unauthorized(Operations.GetCapabilities.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListAgentReviews.Output.Unauthorized { + public var unauthorized: Operations.GetCapabilities.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -34351,9 +39511,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34369,26 +39529,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.NotFound.Body + public var body: Operations.GetCapabilities.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.NotFound.Body) { + public init(body: Operations.GetCapabilities.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/404`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListAgentReviews.Output.NotFound) + case notFound(Operations.GetCapabilities.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListAgentReviews.Output.NotFound { + public var notFound: Operations.GetCapabilities.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -34402,9 +39562,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34420,26 +39580,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.MethodNotAllowed.Body + public var body: Operations.GetCapabilities.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.MethodNotAllowed.Body) { + public init(body: Operations.GetCapabilities.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/405`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListAgentReviews.Output.MethodNotAllowed) + case methodNotAllowed(Operations.GetCapabilities.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListAgentReviews.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.GetCapabilities.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -34453,9 +39613,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34471,26 +39631,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.Conflict.Body + public var body: Operations.GetCapabilities.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.Conflict.Body) { + public init(body: Operations.GetCapabilities.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/409`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListAgentReviews.Output.Conflict) + case conflict(Operations.GetCapabilities.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListAgentReviews.Output.Conflict { + public var conflict: Operations.GetCapabilities.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -34504,9 +39664,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -34522,26 +39682,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.ContentTooLarge.Body + public var body: Operations.GetCapabilities.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.ContentTooLarge.Body) { + public init(body: Operations.GetCapabilities.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/413`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListAgentReviews.Output.ContentTooLarge) + case contentTooLarge(Operations.GetCapabilities.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListAgentReviews.Output.ContentTooLarge { + public var contentTooLarge: Operations.GetCapabilities.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -34555,9 +39715,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34573,26 +39733,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.InternalServerError.Body + public var body: Operations.GetCapabilities.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.InternalServerError.Body) { + public init(body: Operations.GetCapabilities.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/500`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListAgentReviews.Output.InternalServerError) + case internalServerError(Operations.GetCapabilities.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListAgentReviews.Output.InternalServerError { + public var internalServerError: Operations.GetCapabilities.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -34606,9 +39766,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/reviews/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34624,26 +39784,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentReviews.Output.ServiceUnavailable.Body + public var body: Operations.GetCapabilities.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentReviews.Output.ServiceUnavailable.Body) { + public init(body: Operations.GetCapabilities.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/reviews/get(listAgentReviews)/responses/503`. + /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListAgentReviews.Output.ServiceUnavailable) + case serviceUnavailable(Operations.GetCapabilities.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListAgentReviews.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.GetCapabilities.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -34693,62 +39853,125 @@ public enum Operations { } } } - /// The bot's own skill packages, including stale and archived ones. The agent's inline `skills` field lists the same skills by name and instructions. + /// Skill and memory changes by owners, bots, and reviews, newest first, with the state before and after each. Page with `before` set to the last change's ID. /// - /// - Remark: HTTP `GET /v1/agents/{id}/skills`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)`. - public enum ListAgentSkills { - public static let id: Swift.String = "listAgentSkills" + /// - Remark: HTTP `GET /v1/changes`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)`. + public enum ListChanges { + public static let id: Swift.String = "listChanges" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/path/id`. - public var id: Swift.String - /// Creates a new `Path`. + /// - Remark: Generated from `#/paths/v1/changes/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/changes/GET/query/limit`. + public var limit: Swift.Int? + /// - Remark: Generated from `#/paths/v1/changes/GET/query/before`. + public var before: Swift.String? + /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId`. + public struct AgentIdPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId/value1`. + public var value1: Swift.String? + /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId/value2`. + @frozen public enum Value2Payload: String, Codable, Hashable, Sendable, CaseIterable { + case shared = "shared" + } + /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId/value2`. + public var value2: Operations.ListChanges.Input.Query.AgentIdPayload.Value2Payload? + /// Creates a new `AgentIdPayload`. + /// + /// - Parameters: + /// - value1: + /// - value2: + public init( + value1: Swift.String? = nil, + value2: Operations.ListChanges.Input.Query.AgentIdPayload.Value2Payload? = nil + ) { + self.value1 = value1 + self.value2 = value2 + } + public init(from decoder: any Swift.Decoder) throws { + var errors: [any Swift.Error] = [] + do { + self.value1 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + do { + self.value2 = try decoder.decodeFromSingleValueContainer() + } catch { + errors.append(error) + } + try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( + [ + self.value1, + self.value2 + ], + type: Self.self, + codingPath: decoder.codingPath, + errors: errors + ) + } + public func encode(to encoder: any Swift.Encoder) throws { + try encoder.encodeFirstNonNilValueToSingleValueContainer([ + self.value1, + self.value2 + ]) + } + } + /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId`. + public var agentId: Operations.ListChanges.Input.Query.AgentIdPayload? + /// Creates a new `Query`. /// /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id + /// - limit: + /// - before: + /// - agentId: + public init( + limit: Swift.Int? = nil, + before: Swift.String? = nil, + agentId: Operations.ListChanges.Input.Query.AgentIdPayload? = nil + ) { + self.limit = limit + self.before = before + self.agentId = agentId } } - public var path: Operations.ListAgentSkills.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/header`. + public var query: Operations.ListChanges.Input.Query + /// - Remark: Generated from `#/paths/v1/changes/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListAgentSkills.Input.Headers + public var headers: Operations.ListChanges.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: + /// - query: /// - headers: public init( - path: Operations.ListAgentSkills.Input.Path, - headers: Operations.ListAgentSkills.Input.Headers = .init() + query: Operations.ListChanges.Input.Query = .init(), + headers: Operations.ListChanges.Input.Headers = .init() ) { - self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/200/content/application\/json`. - case json([Components.Schemas.SkillPackage]) + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/200/content/application\/json`. + case json([Components.Schemas.LearnedChange]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.SkillPackage] { + public var json: [Components.Schemas.LearnedChange] { get throws { switch self { case let .json(body): @@ -34758,26 +39981,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.Ok.Body + public var body: Operations.ListChanges.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.Ok.Body) { + public init(body: Operations.ListChanges.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/200`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListAgentSkills.Output.Ok) + case ok(Operations.ListChanges.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListAgentSkills.Output.Ok { + public var ok: Operations.ListChanges.Output.Ok { get throws { switch self { case let .ok(response): @@ -34791,9 +40014,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34809,26 +40032,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.BadRequest.Body + public var body: Operations.ListChanges.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.BadRequest.Body) { + public init(body: Operations.ListChanges.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/400`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListAgentSkills.Output.BadRequest) + case badRequest(Operations.ListChanges.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListAgentSkills.Output.BadRequest { + public var badRequest: Operations.ListChanges.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -34842,9 +40065,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -34860,26 +40083,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.Unauthorized.Body + public var body: Operations.ListChanges.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.Unauthorized.Body) { + public init(body: Operations.ListChanges.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/401`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListAgentSkills.Output.Unauthorized) + case unauthorized(Operations.ListChanges.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListAgentSkills.Output.Unauthorized { + public var unauthorized: Operations.ListChanges.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -34893,9 +40116,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34911,26 +40134,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.NotFound.Body + public var body: Operations.ListChanges.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.NotFound.Body) { + public init(body: Operations.ListChanges.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/404`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListAgentSkills.Output.NotFound) + case notFound(Operations.ListChanges.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListAgentSkills.Output.NotFound { + public var notFound: Operations.ListChanges.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -34944,9 +40167,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -34962,26 +40185,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.MethodNotAllowed.Body + public var body: Operations.ListChanges.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListChanges.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/405`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListAgentSkills.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListChanges.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListAgentSkills.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListChanges.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -34995,9 +40218,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35013,26 +40236,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.Conflict.Body + public var body: Operations.ListChanges.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.Conflict.Body) { + public init(body: Operations.ListChanges.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/409`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListAgentSkills.Output.Conflict) + case conflict(Operations.ListChanges.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListAgentSkills.Output.Conflict { + public var conflict: Operations.ListChanges.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -35046,9 +40269,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -35064,26 +40287,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.ContentTooLarge.Body + public var body: Operations.ListChanges.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.ContentTooLarge.Body) { + public init(body: Operations.ListChanges.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/413`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListAgentSkills.Output.ContentTooLarge) + case contentTooLarge(Operations.ListChanges.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListAgentSkills.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListChanges.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -35097,9 +40320,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35115,26 +40338,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.InternalServerError.Body + public var body: Operations.ListChanges.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.InternalServerError.Body) { + public init(body: Operations.ListChanges.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/500`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListAgentSkills.Output.InternalServerError) + case internalServerError(Operations.ListChanges.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListAgentSkills.Output.InternalServerError { + public var internalServerError: Operations.ListChanges.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -35148,9 +40371,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35166,26 +40389,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListAgentSkills.Output.ServiceUnavailable.Body + public var body: Operations.ListChanges.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListAgentSkills.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListChanges.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/get(listAgentSkills)/responses/503`. + /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListAgentSkills.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListChanges.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListAgentSkills.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListChanges.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -35231,133 +40454,66 @@ public enum Operations { [ .json, .plainText - ] - } - } - } - /// - Remark: HTTP `POST /v1/agents/{id}/skills`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)`. - public enum CreateAgentSkill { - public static let id: Swift.String = "createAgentSkill" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.CreateAgentSkill.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/header`. - public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { - self.accept = accept - } - } - public var headers: Operations.CreateAgentSkill.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/DocumentsPayload`. - public struct DocumentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/DocumentsPayload/content`. - public var content: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/DocumentsPayload/path`. - public var path: Swift.String - /// Creates a new `DocumentsPayloadPayload`. - /// - /// - Parameters: - /// - content: - /// - path: - public init( - content: Swift.String, - path: Swift.String - ) { - self.content = content - self.path = path - } - public enum CodingKeys: String, CodingKey { - case content - case path - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/documents`. - public typealias DocumentsPayload = [Operations.CreateAgentSkill.Input.Body.JsonPayload.DocumentsPayloadPayload] - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/documents`. - public var documents: Operations.CreateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/instructions`. - public var instructions: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - description: - /// - documents: - /// - instructions: - /// - name: - public init( - description: Swift.String? = nil, - documents: Operations.CreateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? = nil, - instructions: Swift.String, - name: Swift.String - ) { - self.description = description - self.documents = documents - self.instructions = instructions - self.name = name - } - public enum CodingKeys: String, CodingKey { - case description - case documents - case instructions - case name - } + ] + } + } + } + /// Restores the state before the change, whatever happened since, and records the revert as a change of its own. + /// + /// - Remark: HTTP `POST /v1/changes/{id}/revert`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)`. + public enum RevertChange { + public static let id: Swift.String = "revertChange" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/requestBody/content/application\/json`. - case json(Operations.CreateAgentSkill.Input.Body.JsonPayload) } - public var body: Operations.CreateAgentSkill.Input.Body + public var path: Operations.RevertChange.Input.Path + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.RevertChange.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.CreateAgentSkill.Input.Path, - headers: Operations.CreateAgentSkill.Input.Headers = .init(), - body: Operations.CreateAgentSkill.Input.Body + path: Operations.RevertChange.Input.Path, + headers: Operations.RevertChange.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/201/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/201/content/application\/json`. - case json(Components.Schemas.SkillPackage) + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/201/content/application\/json`. + case json(Components.Schemas.LearnedChange) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.SkillPackage { + public var json: Components.Schemas.LearnedChange { get throws { switch self { case let .json(body): @@ -35367,26 +40523,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.Created.Body + public var body: Operations.RevertChange.Output.Created.Body /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.Created.Body) { + public init(body: Operations.RevertChange.Output.Created.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/201`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/201`. /// /// HTTP response code: `201 created`. - case created(Operations.CreateAgentSkill.Output.Created) + case created(Operations.RevertChange.Output.Created) /// The associated value of the enum case if `self` is `.created`. /// /// - Throws: An error if `self` is not `.created`. /// - SeeAlso: `.created`. - public var created: Operations.CreateAgentSkill.Output.Created { + public var created: Operations.RevertChange.Output.Created { get throws { switch self { case let .created(response): @@ -35400,9 +40556,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35418,26 +40574,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.BadRequest.Body + public var body: Operations.RevertChange.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.BadRequest.Body) { + public init(body: Operations.RevertChange.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/400`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CreateAgentSkill.Output.BadRequest) + case badRequest(Operations.RevertChange.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CreateAgentSkill.Output.BadRequest { + public var badRequest: Operations.RevertChange.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -35451,9 +40607,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -35469,26 +40625,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.Unauthorized.Body + public var body: Operations.RevertChange.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.Unauthorized.Body) { + public init(body: Operations.RevertChange.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/401`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CreateAgentSkill.Output.Unauthorized) + case unauthorized(Operations.RevertChange.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CreateAgentSkill.Output.Unauthorized { + public var unauthorized: Operations.RevertChange.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -35502,9 +40658,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35520,26 +40676,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.NotFound.Body + public var body: Operations.RevertChange.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.NotFound.Body) { + public init(body: Operations.RevertChange.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/404`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CreateAgentSkill.Output.NotFound) + case notFound(Operations.RevertChange.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CreateAgentSkill.Output.NotFound { + public var notFound: Operations.RevertChange.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -35553,9 +40709,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35571,26 +40727,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.MethodNotAllowed.Body + public var body: Operations.RevertChange.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.MethodNotAllowed.Body) { + public init(body: Operations.RevertChange.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/405`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CreateAgentSkill.Output.MethodNotAllowed) + case methodNotAllowed(Operations.RevertChange.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CreateAgentSkill.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.RevertChange.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -35604,9 +40760,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35622,26 +40778,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.Conflict.Body + public var body: Operations.RevertChange.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.Conflict.Body) { + public init(body: Operations.RevertChange.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/409`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CreateAgentSkill.Output.Conflict) + case conflict(Operations.RevertChange.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CreateAgentSkill.Output.Conflict { + public var conflict: Operations.RevertChange.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -35655,9 +40811,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -35673,26 +40829,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.ContentTooLarge.Body + public var body: Operations.RevertChange.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.ContentTooLarge.Body) { + public init(body: Operations.RevertChange.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/413`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CreateAgentSkill.Output.ContentTooLarge) + case contentTooLarge(Operations.RevertChange.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CreateAgentSkill.Output.ContentTooLarge { + public var contentTooLarge: Operations.RevertChange.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -35706,9 +40862,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35724,26 +40880,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.InternalServerError.Body + public var body: Operations.RevertChange.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.InternalServerError.Body) { + public init(body: Operations.RevertChange.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/500`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CreateAgentSkill.Output.InternalServerError) + case internalServerError(Operations.RevertChange.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CreateAgentSkill.Output.InternalServerError { + public var internalServerError: Operations.RevertChange.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -35757,9 +40913,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -35775,26 +40931,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateAgentSkill.Output.ServiceUnavailable.Body + public var body: Operations.RevertChange.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateAgentSkill.Output.ServiceUnavailable.Body) { + public init(body: Operations.RevertChange.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/post(createAgentSkill)/responses/503`. + /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CreateAgentSkill.Output.ServiceUnavailable) + case serviceUnavailable(Operations.RevertChange.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CreateAgentSkill.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.RevertChange.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -35844,319 +41000,133 @@ public enum Operations { } } } - /// Changes a skill's content, restores an archived skill by setting state to active, or pins it so the curator never marks it stale or archives it. - /// - /// - Remark: HTTP `PATCH /v1/agents/{id}/skills/{skillId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)`. - public enum UpdateAgentSkill { - public static let id: Swift.String = "updateAgentSkill" + /// - Remark: HTTP `POST /v1/chat-attention/seen`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)`. + public enum PostChatAttentionSeen { + public static let id: Swift.String = "postChatAttentionSeen" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/path/id`. - public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/path/skillId`. - public var skillId: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - /// - skillId: - public init( - id: Swift.String, - skillId: Swift.String - ) { - self.id = id - self.skillId = skillId - } - } - public var path: Operations.UpdateAgentSkill.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/header`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.UpdateAgentSkill.Input.Headers - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody`. + public var headers: Operations.PostChatAttentionSeen.Input.Headers + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/description`. - public var description: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/DocumentsPayload`. - public struct DocumentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/DocumentsPayload/content`. - public var content: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/DocumentsPayload/path`. - public var path: Swift.String - /// Creates a new `DocumentsPayloadPayload`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json/chat`. + public struct ChatPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json/chat/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json/chat/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case bot = "bot" + case group = "group" + } + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json/chat/kind`. + public var kind: Operations.PostChatAttentionSeen.Input.Body.JsonPayload.ChatPayload.KindPayload + /// Creates a new `ChatPayload`. /// /// - Parameters: - /// - content: - /// - path: + /// - id: + /// - kind: public init( - content: Swift.String, - path: Swift.String + id: Swift.String, + kind: Operations.PostChatAttentionSeen.Input.Body.JsonPayload.ChatPayload.KindPayload ) { - self.content = content - self.path = path + self.id = id + self.kind = kind } public enum CodingKeys: String, CodingKey { - case content - case path + case id + case kind } } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/documents`. - public typealias DocumentsPayload = [Operations.UpdateAgentSkill.Input.Body.JsonPayload.DocumentsPayloadPayload] - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/documents`. - public var documents: Operations.UpdateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/instructions`. - public var instructions: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/pinned`. - public var pinned: Swift.Bool? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case active = "active" - case stale = "stale" - case archived = "archived" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/json/state`. - public var state: Operations.UpdateAgentSkill.Input.Body.JsonPayload.StatePayload? + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json/chat`. + public var chat: Operations.PostChatAttentionSeen.Input.Body.JsonPayload.ChatPayload + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/json/eventIds`. + public var eventIds: [Swift.String] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - description: - /// - documents: - /// - instructions: - /// - name: - /// - pinned: - /// - state: + /// - chat: + /// - eventIds: public init( - description: Swift.String? = nil, - documents: Operations.UpdateAgentSkill.Input.Body.JsonPayload.DocumentsPayload? = nil, - instructions: Swift.String? = nil, - name: Swift.String? = nil, - pinned: Swift.Bool? = nil, - state: Operations.UpdateAgentSkill.Input.Body.JsonPayload.StatePayload? = nil + chat: Operations.PostChatAttentionSeen.Input.Body.JsonPayload.ChatPayload, + eventIds: [Swift.String] ) { - self.description = description - self.documents = documents - self.instructions = instructions - self.name = name - self.pinned = pinned - self.state = state + self.chat = chat + self.eventIds = eventIds } public enum CodingKeys: String, CodingKey { - case description - case documents - case instructions - case name - case pinned - case state + case chat + case eventIds } } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/requestBody/content/application\/json`. - case json(Operations.UpdateAgentSkill.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/requestBody/content/application\/json`. + case json(Operations.PostChatAttentionSeen.Input.Body.JsonPayload) } - public var body: Operations.UpdateAgentSkill.Input.Body + public var body: Operations.PostChatAttentionSeen.Input.Body /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: /// - body: public init( - path: Operations.UpdateAgentSkill.Input.Path, - headers: Operations.UpdateAgentSkill.Input.Headers = .init(), - body: Operations.UpdateAgentSkill.Input.Body + headers: Operations.PostChatAttentionSeen.Input.Headers = .init(), + body: Operations.PostChatAttentionSeen.Input.Body ) { - self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/agentId`. - public var agentId: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/copiedFromSkillId`. - public var copiedFromSkillId: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/createdAt`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/createdBy`. - @frozen public enum CreatedByPayload: String, Codable, Hashable, Sendable, CaseIterable { - case owner = "owner" - case bot = "bot" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/createdBy`. - public var createdBy: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.CreatedByPayload - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/description`. - public var description: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/documents`. - public var documents: [Components.Schemas.SkillDocument] - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/id`. - public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/instructions`. - public var instructions: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/lastUsedAt`. - public var lastUsedAt: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/name`. - public var name: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/origin`. - public var origin: Components.Schemas.SkillOrigin? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/pinned`. - public var pinned: Swift.Bool - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/sourceExecutionId`. - public var sourceExecutionId: Swift.String? - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/state`. - @frozen public enum StatePayload: String, Codable, Hashable, Sendable, CaseIterable { - case active = "active" - case stale = "stale" - case archived = "archived" - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/state`. - public var state: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.StatePayload - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/updatedAt`. - public var updatedAt: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/json/useCount`. - public var useCount: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - agentId: - /// - copiedFromSkillId: - /// - createdAt: - /// - createdBy: - /// - description: - /// - documents: - /// - id: - /// - instructions: - /// - lastUsedAt: - /// - name: - /// - origin: - /// - pinned: - /// - sourceExecutionId: - /// - state: - /// - updatedAt: - /// - useCount: - public init( - agentId: Swift.String? = nil, - copiedFromSkillId: Swift.String? = nil, - createdAt: Swift.String, - createdBy: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.CreatedByPayload, - description: Swift.String, - documents: [Components.Schemas.SkillDocument], - id: Swift.String, - instructions: Swift.String, - lastUsedAt: Swift.String? = nil, - name: Swift.String, - origin: Components.Schemas.SkillOrigin? = nil, - pinned: Swift.Bool, - sourceExecutionId: Swift.String? = nil, - state: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload.StatePayload, - updatedAt: Swift.String, - useCount: Swift.Int - ) { - self.agentId = agentId - self.copiedFromSkillId = copiedFromSkillId - self.createdAt = createdAt - self.createdBy = createdBy - self.description = description - self.documents = documents - self.id = id - self.instructions = instructions - self.lastUsedAt = lastUsedAt - self.name = name - self.origin = origin - self.pinned = pinned - self.sourceExecutionId = sourceExecutionId - self.state = state - self.updatedAt = updatedAt - self.useCount = useCount - } - public enum CodingKeys: String, CodingKey { - case agentId - case copiedFromSkillId - case createdAt - case createdBy - case description - case documents - case id - case instructions - case lastUsedAt - case name - case origin - case pinned - case sourceExecutionId - case state - case updatedAt - case useCount - } - } - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/200/content/application\/json`. - case json(Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload?) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.UpdateAgentSkill.Output.Ok.Body.JsonPayload? { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/200`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateAgentSkill.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.PostChatAttentionSeen.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateAgentSkill.Output.Ok { + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.PostChatAttentionSeen.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36172,26 +41142,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.BadRequest.Body + public var body: Operations.PostChatAttentionSeen.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.BadRequest.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/400`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.UpdateAgentSkill.Output.BadRequest) + case badRequest(Operations.PostChatAttentionSeen.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.UpdateAgentSkill.Output.BadRequest { + public var badRequest: Operations.PostChatAttentionSeen.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -36205,9 +41175,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -36223,26 +41193,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.Unauthorized.Body + public var body: Operations.PostChatAttentionSeen.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.Unauthorized.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/401`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.UpdateAgentSkill.Output.Unauthorized) + case unauthorized(Operations.PostChatAttentionSeen.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.UpdateAgentSkill.Output.Unauthorized { + public var unauthorized: Operations.PostChatAttentionSeen.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -36256,9 +41226,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36274,26 +41244,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.NotFound.Body + public var body: Operations.PostChatAttentionSeen.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.NotFound.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/404`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.UpdateAgentSkill.Output.NotFound) + case notFound(Operations.PostChatAttentionSeen.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.UpdateAgentSkill.Output.NotFound { + public var notFound: Operations.PostChatAttentionSeen.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -36307,9 +41277,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36325,26 +41295,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.MethodNotAllowed.Body + public var body: Operations.PostChatAttentionSeen.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.MethodNotAllowed.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/405`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.UpdateAgentSkill.Output.MethodNotAllowed) + case methodNotAllowed(Operations.PostChatAttentionSeen.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.UpdateAgentSkill.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.PostChatAttentionSeen.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -36358,9 +41328,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36376,26 +41346,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.Conflict.Body + public var body: Operations.PostChatAttentionSeen.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.Conflict.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/409`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.UpdateAgentSkill.Output.Conflict) + case conflict(Operations.PostChatAttentionSeen.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.UpdateAgentSkill.Output.Conflict { + public var conflict: Operations.PostChatAttentionSeen.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -36409,9 +41379,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -36427,26 +41397,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.ContentTooLarge.Body + public var body: Operations.PostChatAttentionSeen.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.ContentTooLarge.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/413`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.UpdateAgentSkill.Output.ContentTooLarge) + case contentTooLarge(Operations.PostChatAttentionSeen.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.UpdateAgentSkill.Output.ContentTooLarge { + public var contentTooLarge: Operations.PostChatAttentionSeen.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -36460,9 +41430,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36478,26 +41448,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.InternalServerError.Body + public var body: Operations.PostChatAttentionSeen.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.InternalServerError.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/500`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.UpdateAgentSkill.Output.InternalServerError) + case internalServerError(Operations.PostChatAttentionSeen.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.UpdateAgentSkill.Output.InternalServerError { + public var internalServerError: Operations.PostChatAttentionSeen.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -36511,9 +41481,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/PATCH/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/seen/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36529,26 +41499,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateAgentSkill.Output.ServiceUnavailable.Body + public var body: Operations.PostChatAttentionSeen.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateAgentSkill.Output.ServiceUnavailable.Body) { + public init(body: Operations.PostChatAttentionSeen.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/patch(updateAgentSkill)/responses/503`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.UpdateAgentSkill.Output.ServiceUnavailable) + case serviceUnavailable(Operations.PostChatAttentionSeen.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.UpdateAgentSkill.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.PostChatAttentionSeen.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -36598,54 +41568,99 @@ public enum Operations { } } } - /// - Remark: HTTP `DELETE /v1/agents/{id}/skills/{skillId}`. - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)`. - public enum DeleteAgentSkill { - public static let id: Swift.String = "deleteAgentSkill" + /// - Remark: HTTP `PUT /v1/chat-attention/views/{viewId}`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)`. + public enum PutChatAttentionView { + public static let id: Swift.String = "putChatAttentionView" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/path`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/path/id`. - public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/path/skillId`. - public var skillId: Swift.String + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/path/viewId`. + public var viewId: Swift.String /// Creates a new `Path`. /// /// - Parameters: - /// - id: - /// - skillId: - public init( - id: Swift.String, - skillId: Swift.String - ) { - self.id = id - self.skillId = skillId + /// - viewId: + public init(viewId: Swift.String) { + self.viewId = viewId } } - public var path: Operations.DeleteAgentSkill.Input.Path - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/header`. + public var path: Operations.PutChatAttentionView.Input.Path + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeleteAgentSkill.Input.Headers + public var headers: Operations.PutChatAttentionView.Input.Headers + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/json/chat`. + public struct ChatPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/json/chat/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/json/chat/kind`. + @frozen public enum KindPayload: String, Codable, Hashable, Sendable, CaseIterable { + case bot = "bot" + case group = "group" + } + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/json/chat/kind`. + public var kind: Operations.PutChatAttentionView.Input.Body.JsonPayload.ChatPayload.KindPayload + /// Creates a new `ChatPayload`. + /// + /// - Parameters: + /// - id: + /// - kind: + public init( + id: Swift.String, + kind: Operations.PutChatAttentionView.Input.Body.JsonPayload.ChatPayload.KindPayload + ) { + self.id = id + self.kind = kind + } + public enum CodingKeys: String, CodingKey { + case id + case kind + } + } + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/json/chat`. + public var chat: Operations.PutChatAttentionView.Input.Body.JsonPayload.ChatPayload? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - chat: + public init(chat: Operations.PutChatAttentionView.Input.Body.JsonPayload.ChatPayload? = nil) { + self.chat = chat + } + public enum CodingKeys: String, CodingKey { + case chat + } + } + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/requestBody/content/application\/json`. + case json(Operations.PutChatAttentionView.Input.Body.JsonPayload) + } + public var body: Operations.PutChatAttentionView.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.DeleteAgentSkill.Input.Path, - headers: Operations.DeleteAgentSkill.Input.Headers = .init() + path: Operations.PutChatAttentionView.Input.Path, + headers: Operations.PutChatAttentionView.Input.Headers = .init(), + body: Operations.PutChatAttentionView.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { @@ -36655,13 +41670,13 @@ public enum Operations { } /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/204`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/204`. /// /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteAgentSkill.Output.NoContent) + case noContent(Operations.PutChatAttentionView.Output.NoContent) /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/204`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/204`. /// /// HTTP response code: `204 noContent`. public static var noContent: Self { @@ -36671,7 +41686,7 @@ public enum Operations { /// /// - Throws: An error if `self` is not `.noContent`. /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteAgentSkill.Output.NoContent { + public var noContent: Operations.PutChatAttentionView.Output.NoContent { get throws { switch self { case let .noContent(response): @@ -36685,9 +41700,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36703,26 +41718,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.BadRequest.Body + public var body: Operations.PutChatAttentionView.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.BadRequest.Body) { + public init(body: Operations.PutChatAttentionView.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/400`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteAgentSkill.Output.BadRequest) + case badRequest(Operations.PutChatAttentionView.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteAgentSkill.Output.BadRequest { + public var badRequest: Operations.PutChatAttentionView.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -36736,9 +41751,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -36754,26 +41769,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.Unauthorized.Body + public var body: Operations.PutChatAttentionView.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.Unauthorized.Body) { + public init(body: Operations.PutChatAttentionView.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/401`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteAgentSkill.Output.Unauthorized) + case unauthorized(Operations.PutChatAttentionView.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteAgentSkill.Output.Unauthorized { + public var unauthorized: Operations.PutChatAttentionView.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -36787,9 +41802,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36805,26 +41820,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.NotFound.Body + public var body: Operations.PutChatAttentionView.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.NotFound.Body) { + public init(body: Operations.PutChatAttentionView.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/404`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteAgentSkill.Output.NotFound) + case notFound(Operations.PutChatAttentionView.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteAgentSkill.Output.NotFound { + public var notFound: Operations.PutChatAttentionView.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -36838,9 +41853,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36856,26 +41871,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.MethodNotAllowed.Body + public var body: Operations.PutChatAttentionView.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.MethodNotAllowed.Body) { + public init(body: Operations.PutChatAttentionView.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/405`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteAgentSkill.Output.MethodNotAllowed) + case methodNotAllowed(Operations.PutChatAttentionView.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteAgentSkill.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.PutChatAttentionView.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -36889,9 +41904,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -36907,26 +41922,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.Conflict.Body + public var body: Operations.PutChatAttentionView.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.Conflict.Body) { + public init(body: Operations.PutChatAttentionView.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/409`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteAgentSkill.Output.Conflict) + case conflict(Operations.PutChatAttentionView.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteAgentSkill.Output.Conflict { + public var conflict: Operations.PutChatAttentionView.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -36940,9 +41955,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -36958,26 +41973,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.ContentTooLarge.Body + public var body: Operations.PutChatAttentionView.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.ContentTooLarge.Body) { + public init(body: Operations.PutChatAttentionView.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/413`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteAgentSkill.Output.ContentTooLarge) + case contentTooLarge(Operations.PutChatAttentionView.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteAgentSkill.Output.ContentTooLarge { + public var contentTooLarge: Operations.PutChatAttentionView.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -36991,9 +42006,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37009,26 +42024,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.InternalServerError.Body + public var body: Operations.PutChatAttentionView.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.InternalServerError.Body) { + public init(body: Operations.PutChatAttentionView.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/500`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteAgentSkill.Output.InternalServerError) + case internalServerError(Operations.PutChatAttentionView.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteAgentSkill.Output.InternalServerError { + public var internalServerError: Operations.PutChatAttentionView.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -37042,9 +42057,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/agents/{id}/skills/{skillId}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/chat-attention/views/{viewId}/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37060,26 +42075,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteAgentSkill.Output.ServiceUnavailable.Body + public var body: Operations.PutChatAttentionView.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteAgentSkill.Output.ServiceUnavailable.Body) { + public init(body: Operations.PutChatAttentionView.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/agents/{id}/skills/{skillId}/delete(deleteAgentSkill)/responses/503`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteAgentSkill.Output.ServiceUnavailable) + case serviceUnavailable(Operations.PutChatAttentionView.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteAgentSkill.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.PutChatAttentionView.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -37129,42 +42144,86 @@ public enum Operations { } } } - /// - Remark: HTTP `GET /v1/capabilities`. - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)`. - public enum GetCapabilities { - public static let id: Swift.String = "getCapabilities" + /// The account's event relay: its URL, whether the Doorstep account token is set (plugin setting `doorstep:token`), and the connection status. + /// + /// - Remark: HTTP `GET /v1/event-relay`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)`. + public enum GetEventRelay { + public static let id: Swift.String = "getEventRelay" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/header`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.GetCapabilities.Input.Headers + public var headers: Operations.GetEventRelay.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - headers: - public init(headers: Operations.GetCapabilities.Input.Headers = .init()) { + public init(headers: Operations.GetEventRelay.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/200/content/application\/json`. - case json(Components.Schemas.Capabilities) + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/error`. + public var error: Swift.String? + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disconnected = "disconnected" + case connecting = "connecting" + case connected = "connected" + case error = "error" + } + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/status`. + public var status: Operations.GetEventRelay.Output.Ok.Body.JsonPayload.StatusPayload + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/tokenConfigured`. + public var tokenConfigured: Swift.Bool + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/url`. + public var url: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - error: + /// - status: + /// - tokenConfigured: + /// - url: + public init( + error: Swift.String? = nil, + status: Operations.GetEventRelay.Output.Ok.Body.JsonPayload.StatusPayload, + tokenConfigured: Swift.Bool, + url: Swift.String? = nil + ) { + self.error = error + self.status = status + self.tokenConfigured = tokenConfigured + self.url = url + } + public enum CodingKeys: String, CodingKey { + case error + case status + case tokenConfigured + case url + } + } + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/application\/json`. + case json(Operations.GetEventRelay.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.Capabilities { + public var json: Operations.GetEventRelay.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -37174,26 +42233,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.Ok.Body + public var body: Operations.GetEventRelay.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.Ok.Body) { + public init(body: Operations.GetEventRelay.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/200`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.GetCapabilities.Output.Ok) + case ok(Operations.GetEventRelay.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.GetCapabilities.Output.Ok { + public var ok: Operations.GetEventRelay.Output.Ok { get throws { switch self { case let .ok(response): @@ -37207,9 +42266,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37225,26 +42284,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.BadRequest.Body + public var body: Operations.GetEventRelay.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.BadRequest.Body) { + public init(body: Operations.GetEventRelay.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/400`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.GetCapabilities.Output.BadRequest) + case badRequest(Operations.GetEventRelay.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.GetCapabilities.Output.BadRequest { + public var badRequest: Operations.GetEventRelay.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -37258,9 +42317,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -37276,26 +42335,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.Unauthorized.Body + public var body: Operations.GetEventRelay.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.Unauthorized.Body) { + public init(body: Operations.GetEventRelay.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/401`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.GetCapabilities.Output.Unauthorized) + case unauthorized(Operations.GetEventRelay.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.GetCapabilities.Output.Unauthorized { + public var unauthorized: Operations.GetEventRelay.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -37309,9 +42368,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37327,26 +42386,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.NotFound.Body + public var body: Operations.GetEventRelay.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.NotFound.Body) { + public init(body: Operations.GetEventRelay.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/404`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.GetCapabilities.Output.NotFound) + case notFound(Operations.GetEventRelay.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.GetCapabilities.Output.NotFound { + public var notFound: Operations.GetEventRelay.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -37360,9 +42419,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37378,26 +42437,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.MethodNotAllowed.Body + public var body: Operations.GetEventRelay.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.MethodNotAllowed.Body) { + public init(body: Operations.GetEventRelay.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/405`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.GetCapabilities.Output.MethodNotAllowed) + case methodNotAllowed(Operations.GetEventRelay.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.GetCapabilities.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.GetEventRelay.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -37411,9 +42470,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37429,26 +42488,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.Conflict.Body + public var body: Operations.GetEventRelay.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.Conflict.Body) { + public init(body: Operations.GetEventRelay.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/409`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.GetCapabilities.Output.Conflict) + case conflict(Operations.GetEventRelay.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.GetCapabilities.Output.Conflict { + public var conflict: Operations.GetEventRelay.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -37462,9 +42521,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -37480,26 +42539,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.ContentTooLarge.Body + public var body: Operations.GetEventRelay.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.ContentTooLarge.Body) { + public init(body: Operations.GetEventRelay.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/413`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.GetCapabilities.Output.ContentTooLarge) + case contentTooLarge(Operations.GetEventRelay.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.GetCapabilities.Output.ContentTooLarge { + public var contentTooLarge: Operations.GetEventRelay.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -37513,9 +42572,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37531,26 +42590,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.InternalServerError.Body + public var body: Operations.GetEventRelay.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.InternalServerError.Body) { + public init(body: Operations.GetEventRelay.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/500`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.GetCapabilities.Output.InternalServerError) + case internalServerError(Operations.GetEventRelay.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.GetCapabilities.Output.InternalServerError { + public var internalServerError: Operations.GetEventRelay.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -37564,9 +42623,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/capabilities/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37582,26 +42641,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetCapabilities.Output.ServiceUnavailable.Body + public var body: Operations.GetEventRelay.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetCapabilities.Output.ServiceUnavailable.Body) { + public init(body: Operations.GetEventRelay.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/capabilities/get(getCapabilities)/responses/503`. + /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.GetCapabilities.Output.ServiceUnavailable) + case serviceUnavailable(Operations.GetEventRelay.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.GetCapabilities.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.GetEventRelay.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -37615,161 +42674,158 @@ public enum Operations { } } /// Undocumented response. - /// - /// A response with a code that is not documented in the OpenAPI document. - case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) - } - @frozen public enum AcceptableContentType: AcceptableProtocol { - case json - case plainText - case other(Swift.String) - public init?(rawValue: Swift.String) { - switch rawValue.lowercased() { - case "application/json": - self = .json - case "text/plain": - self = .plainText - default: - self = .other(rawValue) - } - } - public var rawValue: Swift.String { - switch self { - case let .other(string): - return string - case .json: - return "application/json" - case .plainText: - return "text/plain" - } - } - public static var allCases: [Self] { - [ - .json, - .plainText - ] - } - } - } - /// Skill and memory changes by owners, bots, and reviews, newest first, with the state before and after each. Page with `before` set to the last change's ID. - /// - /// - Remark: HTTP `GET /v1/changes`. - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)`. - public enum ListChanges { - public static let id: Swift.String = "listChanges" - public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/query/limit`. - public var limit: Swift.Int? - /// - Remark: Generated from `#/paths/v1/changes/GET/query/before`. - public var before: Swift.String? - /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId`. - public struct AgentIdPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId/value1`. - public var value1: Swift.String? - /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId/value2`. - @frozen public enum Value2Payload: String, Codable, Hashable, Sendable, CaseIterable { - case shared = "shared" - } - /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId/value2`. - public var value2: Operations.ListChanges.Input.Query.AgentIdPayload.Value2Payload? - /// Creates a new `AgentIdPayload`. - /// - /// - Parameters: - /// - value1: - /// - value2: - public init( - value1: Swift.String? = nil, - value2: Operations.ListChanges.Input.Query.AgentIdPayload.Value2Payload? = nil - ) { - self.value1 = value1 - self.value2 = value2 - } - public init(from decoder: any Swift.Decoder) throws { - var errors: [any Swift.Error] = [] - do { - self.value1 = try decoder.decodeFromSingleValueContainer() - } catch { - errors.append(error) - } - do { - self.value2 = try decoder.decodeFromSingleValueContainer() - } catch { - errors.append(error) - } - try Swift.DecodingError.verifyAtLeastOneSchemaIsNotNil( - [ - self.value1, - self.value2 - ], - type: Self.self, - codingPath: decoder.codingPath, - errors: errors - ) - } - public func encode(to encoder: any Swift.Encoder) throws { - try encoder.encodeFirstNonNilValueToSingleValueContainer([ - self.value1, - self.value2 - ]) - } + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) } - /// - Remark: Generated from `#/paths/v1/changes/GET/query/agentId`. - public var agentId: Operations.ListChanges.Input.Query.AgentIdPayload? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - limit: - /// - before: - /// - agentId: - public init( - limit: Swift.Int? = nil, - before: Swift.String? = nil, - agentId: Operations.ListChanges.Input.Query.AgentIdPayload? = nil - ) { - self.limit = limit - self.before = before - self.agentId = agentId + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" } } - public var query: Operations.ListChanges.Input.Query - /// - Remark: Generated from `#/paths/v1/changes/GET/header`. + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } + /// Sets the event relay URL, or removes it with `null`, which disconnects the relay. + /// + /// - Remark: HTTP `PUT /v1/event-relay`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)`. + public enum UpdateEventRelay { + public static let id: Swift.String = "updateEventRelay" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListChanges.Input.Headers + public var headers: Operations.UpdateEventRelay.Input.Headers + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody/json/url`. + public var url: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - url: + public init(url: Swift.String? = nil) { + self.url = url + } + public enum CodingKeys: String, CodingKey { + case url + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.url = try container.decodeIfPresent( + Swift.String.self, + forKey: .url + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "url" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody/content/application\/json`. + case json(Operations.UpdateEventRelay.Input.Body.JsonPayload) + } + public var body: Operations.UpdateEventRelay.Input.Body /// Creates a new `Input`. /// /// - Parameters: - /// - query: /// - headers: + /// - body: public init( - query: Operations.ListChanges.Input.Query = .init(), - headers: Operations.ListChanges.Input.Headers = .init() + headers: Operations.UpdateEventRelay.Input.Headers = .init(), + body: Operations.UpdateEventRelay.Input.Body ) { - self.query = query self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/200/content/application\/json`. - case json([Components.Schemas.LearnedChange]) + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/error`. + public var error: Swift.String? + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/status`. + @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { + case disconnected = "disconnected" + case connecting = "connecting" + case connected = "connected" + case error = "error" + } + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/status`. + public var status: Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload.StatusPayload + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/tokenConfigured`. + public var tokenConfigured: Swift.Bool + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/url`. + public var url: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - error: + /// - status: + /// - tokenConfigured: + /// - url: + public init( + error: Swift.String? = nil, + status: Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload.StatusPayload, + tokenConfigured: Swift.Bool, + url: Swift.String? = nil + ) { + self.error = error + self.status = status + self.tokenConfigured = tokenConfigured + self.url = url + } + public enum CodingKeys: String, CodingKey { + case error + case status + case tokenConfigured + case url + } + } + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/application\/json`. + case json(Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.LearnedChange] { + public var json: Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -37779,26 +42835,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.Ok.Body + public var body: Operations.UpdateEventRelay.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.Ok.Body) { + public init(body: Operations.UpdateEventRelay.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/200`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListChanges.Output.Ok) + case ok(Operations.UpdateEventRelay.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListChanges.Output.Ok { + public var ok: Operations.UpdateEventRelay.Output.Ok { get throws { switch self { case let .ok(response): @@ -37812,9 +42868,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37830,26 +42886,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.BadRequest.Body + public var body: Operations.UpdateEventRelay.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.BadRequest.Body) { + public init(body: Operations.UpdateEventRelay.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/400`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListChanges.Output.BadRequest) + case badRequest(Operations.UpdateEventRelay.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListChanges.Output.BadRequest { + public var badRequest: Operations.UpdateEventRelay.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -37863,9 +42919,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -37881,26 +42937,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.Unauthorized.Body + public var body: Operations.UpdateEventRelay.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.Unauthorized.Body) { + public init(body: Operations.UpdateEventRelay.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/401`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListChanges.Output.Unauthorized) + case unauthorized(Operations.UpdateEventRelay.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListChanges.Output.Unauthorized { + public var unauthorized: Operations.UpdateEventRelay.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -37914,9 +42970,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37932,26 +42988,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.NotFound.Body + public var body: Operations.UpdateEventRelay.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.NotFound.Body) { + public init(body: Operations.UpdateEventRelay.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/404`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListChanges.Output.NotFound) + case notFound(Operations.UpdateEventRelay.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListChanges.Output.NotFound { + public var notFound: Operations.UpdateEventRelay.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -37965,9 +43021,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -37983,26 +43039,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.MethodNotAllowed.Body + public var body: Operations.UpdateEventRelay.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.MethodNotAllowed.Body) { + public init(body: Operations.UpdateEventRelay.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/405`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListChanges.Output.MethodNotAllowed) + case methodNotAllowed(Operations.UpdateEventRelay.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListChanges.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.UpdateEventRelay.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -38016,9 +43072,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38034,26 +43090,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.Conflict.Body + public var body: Operations.UpdateEventRelay.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.Conflict.Body) { + public init(body: Operations.UpdateEventRelay.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/409`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListChanges.Output.Conflict) + case conflict(Operations.UpdateEventRelay.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListChanges.Output.Conflict { + public var conflict: Operations.UpdateEventRelay.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -38067,9 +43123,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -38085,26 +43141,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.ContentTooLarge.Body + public var body: Operations.UpdateEventRelay.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.ContentTooLarge.Body) { + public init(body: Operations.UpdateEventRelay.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/413`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListChanges.Output.ContentTooLarge) + case contentTooLarge(Operations.UpdateEventRelay.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListChanges.Output.ContentTooLarge { + public var contentTooLarge: Operations.UpdateEventRelay.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -38118,9 +43174,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38136,26 +43192,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.InternalServerError.Body + public var body: Operations.UpdateEventRelay.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.InternalServerError.Body) { + public init(body: Operations.UpdateEventRelay.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/500`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListChanges.Output.InternalServerError) + case internalServerError(Operations.UpdateEventRelay.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListChanges.Output.InternalServerError { + public var internalServerError: Operations.UpdateEventRelay.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -38169,9 +43225,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38187,26 +43243,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListChanges.Output.ServiceUnavailable.Body + public var body: Operations.UpdateEventRelay.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListChanges.Output.ServiceUnavailable.Body) { + public init(body: Operations.UpdateEventRelay.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/changes/get(listChanges)/responses/503`. + /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListChanges.Output.ServiceUnavailable) + case serviceUnavailable(Operations.UpdateEventRelay.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListChanges.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.UpdateEventRelay.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -38256,62 +43312,96 @@ public enum Operations { } } } - /// Restores the state before the change, whatever happened since, and records the revert as a change of its own. + /// The account's event sources, each with the number of automations that use it. /// - /// - Remark: HTTP `POST /v1/changes/{id}/revert`. - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)`. - public enum RevertChange { - public static let id: Swift.String = "revertChange" + /// - Remark: HTTP `GET /v1/event-sources`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)`. + public enum ListEventSources { + public static let id: Swift.String = "listEventSources" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.RevertChange.Input.Path - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/header`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.RevertChange.Input.Headers + public var headers: Operations.ListEventSources.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: - public init( - path: Operations.RevertChange.Input.Path, - headers: Operations.RevertChange.Input.Headers = .init() - ) { - self.path = path + public init(headers: Operations.ListEventSources.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/201/content/application\/json`. - case json(Components.Schemas.LearnedChange) + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload`. + public struct SourcesPayloadPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/createdAt`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/name`. + public var name: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/usedBy`. + public var usedBy: Swift.Int + /// Creates a new `SourcesPayloadPayload`. + /// + /// - Parameters: + /// - createdAt: + /// - id: + /// - name: + /// - usedBy: + public init( + createdAt: Swift.String, + id: Swift.String, + name: Swift.String, + usedBy: Swift.Int + ) { + self.createdAt = createdAt + self.id = id + self.name = name + self.usedBy = usedBy + } + public enum CodingKeys: String, CodingKey { + case createdAt + case id + case name + case usedBy + } + } + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/sources`. + public typealias SourcesPayload = [Operations.ListEventSources.Output.Ok.Body.JsonPayload.SourcesPayloadPayload] + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/sources`. + public var sources: Operations.ListEventSources.Output.Ok.Body.JsonPayload.SourcesPayload + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - sources: + public init(sources: Operations.ListEventSources.Output.Ok.Body.JsonPayload.SourcesPayload) { + self.sources = sources + } + public enum CodingKeys: String, CodingKey { + case sources + } + } + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/application\/json`. + case json(Operations.ListEventSources.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.LearnedChange { + public var json: Operations.ListEventSources.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -38321,42 +43411,42 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ListEventSources.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.Created.Body) { + public init(body: Operations.ListEventSources.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/201`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.RevertChange.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ListEventSources.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.RevertChange.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListEventSources.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38372,26 +43462,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.BadRequest.Body + public var body: Operations.ListEventSources.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.BadRequest.Body) { + public init(body: Operations.ListEventSources.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/400`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.RevertChange.Output.BadRequest) + case badRequest(Operations.ListEventSources.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.RevertChange.Output.BadRequest { + public var badRequest: Operations.ListEventSources.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -38405,9 +43495,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -38423,26 +43513,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.Unauthorized.Body + public var body: Operations.ListEventSources.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.Unauthorized.Body) { + public init(body: Operations.ListEventSources.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/401`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.RevertChange.Output.Unauthorized) + case unauthorized(Operations.ListEventSources.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.RevertChange.Output.Unauthorized { + public var unauthorized: Operations.ListEventSources.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -38456,9 +43546,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38474,26 +43564,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.NotFound.Body + public var body: Operations.ListEventSources.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.NotFound.Body) { + public init(body: Operations.ListEventSources.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/404`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.RevertChange.Output.NotFound) + case notFound(Operations.ListEventSources.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.RevertChange.Output.NotFound { + public var notFound: Operations.ListEventSources.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -38507,9 +43597,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38525,26 +43615,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.MethodNotAllowed.Body + public var body: Operations.ListEventSources.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListEventSources.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/405`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.RevertChange.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListEventSources.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.RevertChange.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListEventSources.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -38558,9 +43648,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38576,26 +43666,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.Conflict.Body + public var body: Operations.ListEventSources.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.Conflict.Body) { + public init(body: Operations.ListEventSources.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/409`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.RevertChange.Output.Conflict) + case conflict(Operations.ListEventSources.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.RevertChange.Output.Conflict { + public var conflict: Operations.ListEventSources.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -38609,9 +43699,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -38627,26 +43717,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.ContentTooLarge.Body + public var body: Operations.ListEventSources.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.ContentTooLarge.Body) { + public init(body: Operations.ListEventSources.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/413`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.RevertChange.Output.ContentTooLarge) + case contentTooLarge(Operations.ListEventSources.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.RevertChange.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListEventSources.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -38660,9 +43750,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38678,26 +43768,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.InternalServerError.Body + public var body: Operations.ListEventSources.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.InternalServerError.Body) { + public init(body: Operations.ListEventSources.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/500`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.RevertChange.Output.InternalServerError) + case internalServerError(Operations.ListEventSources.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.RevertChange.Output.InternalServerError { + public var internalServerError: Operations.ListEventSources.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -38711,9 +43801,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/changes/{id}/revert/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38729,26 +43819,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.RevertChange.Output.ServiceUnavailable.Body + public var body: Operations.ListEventSources.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.RevertChange.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListEventSources.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)/responses/503`. + /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.RevertChange.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListEventSources.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.RevertChange.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListEventSources.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -38798,86 +43888,121 @@ public enum Operations { } } } - /// The account's event relay: its URL, whether the Doorstep account token is set (plugin setting `doorstep:token`), and the connection status. + /// Creates a source on the event relay. The response's `address` contains the source's secret and is returned only once. 400 when the relay URL or token is missing, or the relay can't be reached or rejects the token. /// - /// - Remark: HTTP `GET /v1/event-relay`. - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)`. - public enum GetEventRelay { - public static let id: Swift.String = "getEventRelay" + /// - Remark: HTTP `POST /v1/event-sources`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)`. + public enum CreateEventSource { + public static let id: Swift.String = "createEventSource" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/header`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.GetEventRelay.Input.Headers + public var headers: Operations.CreateEventSource.Input.Headers + /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody/json/name`. + public var name: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - name: + public init(name: Swift.String) { + self.name = name + } + public enum CodingKeys: String, CodingKey { + case name + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.name = try container.decode( + Swift.String.self, + forKey: .name + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "name" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody/content/application\/json`. + case json(Operations.CreateEventSource.Input.Body.JsonPayload) + } + public var body: Operations.CreateEventSource.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - headers: - public init(headers: Operations.GetEventRelay.Input.Headers = .init()) { + /// - body: + public init( + headers: Operations.CreateEventSource.Input.Headers = .init(), + body: Operations.CreateEventSource.Input.Body + ) { self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/error`. - public var error: Swift.String? - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case disconnected = "disconnected" - case connecting = "connecting" - case connected = "connected" - case error = "error" - } - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/status`. - public var status: Operations.GetEventRelay.Output.Ok.Body.JsonPayload.StatusPayload - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/tokenConfigured`. - public var tokenConfigured: Swift.Bool - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/json/url`. - public var url: Swift.String? + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/address`. + public var address: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/createdAt`. + public var createdAt: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/id`. + public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/name`. + public var name: Swift.String + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/usedBy`. + public var usedBy: Swift.Int /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - error: - /// - status: - /// - tokenConfigured: - /// - url: + /// - address: + /// - createdAt: + /// - id: + /// - name: + /// - usedBy: public init( - error: Swift.String? = nil, - status: Operations.GetEventRelay.Output.Ok.Body.JsonPayload.StatusPayload, - tokenConfigured: Swift.Bool, - url: Swift.String? = nil + address: Swift.String, + createdAt: Swift.String, + id: Swift.String, + name: Swift.String, + usedBy: Swift.Int ) { - self.error = error - self.status = status - self.tokenConfigured = tokenConfigured - self.url = url + self.address = address + self.createdAt = createdAt + self.id = id + self.name = name + self.usedBy = usedBy } public enum CodingKeys: String, CodingKey { - case error - case status - case tokenConfigured - case url + case address + case createdAt + case id + case name + case usedBy } } - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/200/content/application\/json`. - case json(Operations.GetEventRelay.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/application\/json`. + case json(Operations.CreateEventSource.Output.Created.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.GetEventRelay.Output.Ok.Body.JsonPayload { + public var json: Operations.CreateEventSource.Output.Created.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -38887,42 +44012,42 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.CreateEventSource.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.Ok.Body) { + public init(body: Operations.CreateEventSource.Output.Created.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/200`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetEventRelay.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.CreateEventSource.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetEventRelay.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CreateEventSource.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -38938,26 +44063,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.BadRequest.Body + public var body: Operations.CreateEventSource.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.BadRequest.Body) { + public init(body: Operations.CreateEventSource.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/400`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.GetEventRelay.Output.BadRequest) + case badRequest(Operations.CreateEventSource.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.GetEventRelay.Output.BadRequest { + public var badRequest: Operations.CreateEventSource.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -38971,9 +44096,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -38989,26 +44114,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.Unauthorized.Body + public var body: Operations.CreateEventSource.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.Unauthorized.Body) { + public init(body: Operations.CreateEventSource.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/401`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.GetEventRelay.Output.Unauthorized) + case unauthorized(Operations.CreateEventSource.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.GetEventRelay.Output.Unauthorized { + public var unauthorized: Operations.CreateEventSource.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -39022,9 +44147,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39040,26 +44165,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.NotFound.Body + public var body: Operations.CreateEventSource.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.NotFound.Body) { + public init(body: Operations.CreateEventSource.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/404`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.GetEventRelay.Output.NotFound) + case notFound(Operations.CreateEventSource.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.GetEventRelay.Output.NotFound { + public var notFound: Operations.CreateEventSource.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -39073,9 +44198,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39091,26 +44216,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.MethodNotAllowed.Body + public var body: Operations.CreateEventSource.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.MethodNotAllowed.Body) { + public init(body: Operations.CreateEventSource.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/405`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.GetEventRelay.Output.MethodNotAllowed) + case methodNotAllowed(Operations.CreateEventSource.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.GetEventRelay.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.CreateEventSource.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -39124,9 +44249,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39142,26 +44267,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.Conflict.Body + public var body: Operations.CreateEventSource.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.Conflict.Body) { + public init(body: Operations.CreateEventSource.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/409`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.GetEventRelay.Output.Conflict) + case conflict(Operations.CreateEventSource.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.GetEventRelay.Output.Conflict { + public var conflict: Operations.CreateEventSource.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -39175,9 +44300,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -39193,26 +44318,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.ContentTooLarge.Body + public var body: Operations.CreateEventSource.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.ContentTooLarge.Body) { + public init(body: Operations.CreateEventSource.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/413`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.GetEventRelay.Output.ContentTooLarge) + case contentTooLarge(Operations.CreateEventSource.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.GetEventRelay.Output.ContentTooLarge { + public var contentTooLarge: Operations.CreateEventSource.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -39226,9 +44351,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39244,26 +44369,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.InternalServerError.Body + public var body: Operations.CreateEventSource.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.InternalServerError.Body) { + public init(body: Operations.CreateEventSource.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/500`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.GetEventRelay.Output.InternalServerError) + case internalServerError(Operations.CreateEventSource.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.GetEventRelay.Output.InternalServerError { + public var internalServerError: Operations.CreateEventSource.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -39277,9 +44402,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39295,26 +44420,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetEventRelay.Output.ServiceUnavailable.Body + public var body: Operations.CreateEventSource.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetEventRelay.Output.ServiceUnavailable.Body) { + public init(body: Operations.CreateEventSource.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/event-relay/get(getEventRelay)/responses/503`. + /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.GetEventRelay.Output.ServiceUnavailable) + case serviceUnavailable(Operations.CreateEventSource.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.GetEventRelay.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.CreateEventSource.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -39364,167 +44489,91 @@ public enum Operations { } } } - /// Sets the event relay URL, or removes it with `null`, which disconnects the relay. + /// Deletes the source on the event relay and in Crumble; its address stops working. 409 while an automation uses it. /// - /// - Remark: HTTP `PUT /v1/event-relay`. - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)`. - public enum UpdateEventRelay { - public static let id: Swift.String = "updateEventRelay" + /// - Remark: HTTP `DELETE /v1/event-sources/{id}`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)`. + public enum DeleteEventSource { + public static let id: Swift.String = "deleteEventSource" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/header`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.DeleteEventSource.Input.Path + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.UpdateEventRelay.Input.Headers - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody/json/url`. - public var url: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - url: - public init(url: Swift.String? = nil) { - self.url = url - } - public enum CodingKeys: String, CodingKey { - case url - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.url = try container.decodeIfPresent( - Swift.String.self, - forKey: .url - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "url" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/requestBody/content/application\/json`. - case json(Operations.UpdateEventRelay.Input.Body.JsonPayload) - } - public var body: Operations.UpdateEventRelay.Input.Body + public var headers: Operations.DeleteEventSource.Input.Headers /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: - /// - body: public init( - headers: Operations.UpdateEventRelay.Input.Headers = .init(), - body: Operations.UpdateEventRelay.Input.Body + path: Operations.DeleteEventSource.Input.Path, + headers: Operations.DeleteEventSource.Input.Headers = .init() ) { + self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/error`. - public var error: Swift.String? - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/status`. - @frozen public enum StatusPayload: String, Codable, Hashable, Sendable, CaseIterable { - case disconnected = "disconnected" - case connecting = "connecting" - case connected = "connected" - case error = "error" - } - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/status`. - public var status: Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload.StatusPayload - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/tokenConfigured`. - public var tokenConfigured: Swift.Bool - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/json/url`. - public var url: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - error: - /// - status: - /// - tokenConfigured: - /// - url: - public init( - error: Swift.String? = nil, - status: Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload.StatusPayload, - tokenConfigured: Swift.Bool, - url: Swift.String? = nil - ) { - self.error = error - self.status = status - self.tokenConfigured = tokenConfigured - self.url = url - } - public enum CodingKeys: String, CodingKey { - case error - case status - case tokenConfigured - case url - } - } - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/200/content/application\/json`. - case json(Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.UpdateEventRelay.Output.Ok.Body.JsonPayload { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/200`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.UpdateEventRelay.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteEventSource.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateEventRelay.Output.Ok { + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteEventSource.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39540,26 +44589,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.BadRequest.Body + public var body: Operations.DeleteEventSource.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.BadRequest.Body) { + public init(body: Operations.DeleteEventSource.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/400`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.UpdateEventRelay.Output.BadRequest) + case badRequest(Operations.DeleteEventSource.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.UpdateEventRelay.Output.BadRequest { + public var badRequest: Operations.DeleteEventSource.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -39573,9 +44622,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -39591,26 +44640,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.Unauthorized.Body + public var body: Operations.DeleteEventSource.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.Unauthorized.Body) { + public init(body: Operations.DeleteEventSource.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/401`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.UpdateEventRelay.Output.Unauthorized) + case unauthorized(Operations.DeleteEventSource.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.UpdateEventRelay.Output.Unauthorized { + public var unauthorized: Operations.DeleteEventSource.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -39624,9 +44673,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39642,26 +44691,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.NotFound.Body + public var body: Operations.DeleteEventSource.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.NotFound.Body) { + public init(body: Operations.DeleteEventSource.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/404`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.UpdateEventRelay.Output.NotFound) + case notFound(Operations.DeleteEventSource.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.UpdateEventRelay.Output.NotFound { + public var notFound: Operations.DeleteEventSource.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -39675,9 +44724,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39693,26 +44742,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.MethodNotAllowed.Body + public var body: Operations.DeleteEventSource.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteEventSource.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/405`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.UpdateEventRelay.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteEventSource.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.UpdateEventRelay.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteEventSource.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -39726,9 +44775,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39744,26 +44793,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.Conflict.Body + public var body: Operations.DeleteEventSource.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.Conflict.Body) { + public init(body: Operations.DeleteEventSource.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/409`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.UpdateEventRelay.Output.Conflict) + case conflict(Operations.DeleteEventSource.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.UpdateEventRelay.Output.Conflict { + public var conflict: Operations.DeleteEventSource.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -39777,9 +44826,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -39795,26 +44844,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.ContentTooLarge.Body + public var body: Operations.DeleteEventSource.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteEventSource.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/413`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.UpdateEventRelay.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteEventSource.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.UpdateEventRelay.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteEventSource.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -39828,9 +44877,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39846,26 +44895,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.InternalServerError.Body + public var body: Operations.DeleteEventSource.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.InternalServerError.Body) { + public init(body: Operations.DeleteEventSource.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/500`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.UpdateEventRelay.Output.InternalServerError) + case internalServerError(Operations.DeleteEventSource.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.UpdateEventRelay.Output.InternalServerError { + public var internalServerError: Operations.DeleteEventSource.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -39879,9 +44928,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-relay/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -39897,26 +44946,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateEventRelay.Output.ServiceUnavailable.Body + public var body: Operations.DeleteEventSource.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateEventRelay.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteEventSource.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/event-relay/put(updateEventRelay)/responses/503`. + /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.UpdateEventRelay.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteEventSource.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.UpdateEventRelay.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteEventSource.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -39966,125 +45015,73 @@ public enum Operations { } } } - /// The account's event sources, each with the number of automations that use it. + /// Server-sent events. Each activity event carries a ReplyEvent or ChatPreviewEvent JSON object in data. Each learned event carries a LearnedEvent: what a bot's review of one turn changed; GET /v1/agents/{id}/reviews lists them durably. Current chat previews replay on connection; finished replies and learned events are not replayed. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. No Last-Event-ID replay. /// - /// - Remark: HTTP `GET /v1/event-sources`. - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)`. - public enum ListEventSources { - public static let id: Swift.String = "listEventSources" + /// - Remark: HTTP `GET /v1/events`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)`. + public enum StreamActivityEvents { + public static let id: Swift.String = "streamActivityEvents" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/header`. + /// - Remark: Generated from `#/paths/v1/events/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListEventSources.Input.Headers + public var headers: Operations.StreamActivityEvents.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - headers: - public init(headers: Operations.ListEventSources.Input.Headers = .init()) { + public init(headers: Operations.StreamActivityEvents.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload`. - public struct SourcesPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/createdAt`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/id`. - public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/name`. - public var name: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/SourcesPayload/usedBy`. - public var usedBy: Swift.Int - /// Creates a new `SourcesPayloadPayload`. - /// - /// - Parameters: - /// - createdAt: - /// - id: - /// - name: - /// - usedBy: - public init( - createdAt: Swift.String, - id: Swift.String, - name: Swift.String, - usedBy: Swift.Int - ) { - self.createdAt = createdAt - self.id = id - self.name = name - self.usedBy = usedBy - } - public enum CodingKeys: String, CodingKey { - case createdAt - case id - case name - case usedBy - } - } - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/sources`. - public typealias SourcesPayload = [Operations.ListEventSources.Output.Ok.Body.JsonPayload.SourcesPayloadPayload] - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/json/sources`. - public var sources: Operations.ListEventSources.Output.Ok.Body.JsonPayload.SourcesPayload - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - sources: - public init(sources: Operations.ListEventSources.Output.Ok.Body.JsonPayload.SourcesPayload) { - self.sources = sources - } - public enum CodingKeys: String, CodingKey { - case sources - } - } - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/200/content/application\/json`. - case json(Operations.ListEventSources.Output.Ok.Body.JsonPayload) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/200/content/text\/event-stream`. + case textEventStream(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.textEventStream`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Operations.ListEventSources.Output.Ok.Body.JsonPayload { + /// - Throws: An error if `self` is not `.textEventStream`. + /// - SeeAlso: `.textEventStream`. + public var textEventStream: OpenAPIRuntime.HTTPBody { get throws { switch self { - case let .json(body): + case let .textEventStream(body): return body } } } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.Ok.Body + public var body: Operations.StreamActivityEvents.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.Ok.Body) { + public init(body: Operations.StreamActivityEvents.Output.Ok.Body) { self.body = body } } - /// Success + /// SSE stream, not a JSON array /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/200`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListEventSources.Output.Ok) + case ok(Operations.StreamActivityEvents.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListEventSources.Output.Ok { + public var ok: Operations.StreamActivityEvents.Output.Ok { get throws { switch self { case let .ok(response): @@ -40098,9 +45095,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40116,26 +45113,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.BadRequest.Body + public var body: Operations.StreamActivityEvents.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.BadRequest.Body) { + public init(body: Operations.StreamActivityEvents.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/400`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListEventSources.Output.BadRequest) + case badRequest(Operations.StreamActivityEvents.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListEventSources.Output.BadRequest { + public var badRequest: Operations.StreamActivityEvents.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -40149,9 +45146,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -40167,26 +45164,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.Unauthorized.Body + public var body: Operations.StreamActivityEvents.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.Unauthorized.Body) { + public init(body: Operations.StreamActivityEvents.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/401`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListEventSources.Output.Unauthorized) + case unauthorized(Operations.StreamActivityEvents.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListEventSources.Output.Unauthorized { + public var unauthorized: Operations.StreamActivityEvents.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -40200,9 +45197,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40218,26 +45215,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.NotFound.Body + public var body: Operations.StreamActivityEvents.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.NotFound.Body) { + public init(body: Operations.StreamActivityEvents.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/404`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListEventSources.Output.NotFound) + case notFound(Operations.StreamActivityEvents.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListEventSources.Output.NotFound { + public var notFound: Operations.StreamActivityEvents.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -40251,9 +45248,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40269,26 +45266,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.MethodNotAllowed.Body + public var body: Operations.StreamActivityEvents.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.MethodNotAllowed.Body) { + public init(body: Operations.StreamActivityEvents.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/405`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListEventSources.Output.MethodNotAllowed) + case methodNotAllowed(Operations.StreamActivityEvents.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListEventSources.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.StreamActivityEvents.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -40302,9 +45299,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40320,26 +45317,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.Conflict.Body + public var body: Operations.StreamActivityEvents.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.Conflict.Body) { + public init(body: Operations.StreamActivityEvents.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/409`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListEventSources.Output.Conflict) + case conflict(Operations.StreamActivityEvents.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListEventSources.Output.Conflict { + public var conflict: Operations.StreamActivityEvents.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -40353,9 +45350,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -40371,26 +45368,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.ContentTooLarge.Body + public var body: Operations.StreamActivityEvents.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.ContentTooLarge.Body) { + public init(body: Operations.StreamActivityEvents.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/413`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListEventSources.Output.ContentTooLarge) + case contentTooLarge(Operations.StreamActivityEvents.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListEventSources.Output.ContentTooLarge { + public var contentTooLarge: Operations.StreamActivityEvents.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -40404,9 +45401,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40422,26 +45419,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.InternalServerError.Body + public var body: Operations.StreamActivityEvents.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.InternalServerError.Body) { + public init(body: Operations.StreamActivityEvents.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/500`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListEventSources.Output.InternalServerError) + case internalServerError(Operations.StreamActivityEvents.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListEventSources.Output.InternalServerError { + public var internalServerError: Operations.StreamActivityEvents.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -40455,9 +45452,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/events/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40473,26 +45470,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListEventSources.Output.ServiceUnavailable.Body + public var body: Operations.StreamActivityEvents.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListEventSources.Output.ServiceUnavailable.Body) { + public init(body: Operations.StreamActivityEvents.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/event-sources/get(listEventSources)/responses/503`. + /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListEventSources.Output.ServiceUnavailable) + case serviceUnavailable(Operations.StreamActivityEvents.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListEventSources.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.StreamActivityEvents.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -40511,11 +45508,14 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { + case textEventStream case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { + case "text/event-stream": + self = .textEventStream case "application/json": self = .json case "text/plain": @@ -40528,6 +45528,8 @@ public enum Operations { switch self { case let .other(string): return string + case .textEventStream: + return "text/event-stream" case .json: return "application/json" case .plainText: @@ -40536,127 +45538,67 @@ public enum Operations { } public static var allCases: [Self] { [ + .textEventStream, .json, .plainText ] } } } - /// Creates a source on the event relay. The response's `address` contains the source's secret and is returned only once. 400 when the relay URL or token is missing, or the relay can't be reached or rejects the token. - /// - /// - Remark: HTTP `POST /v1/event-sources`. - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)`. - public enum CreateEventSource { - public static let id: Swift.String = "createEventSource" + /// - Remark: HTTP `GET /v1/executions`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)`. + public enum ListExecutions { + public static let id: Swift.String = "listExecutions" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/header`. + /// - Remark: Generated from `#/paths/v1/executions/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/executions/GET/query/agentId`. + public var agentId: Swift.String? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - agentId: + public init(agentId: Swift.String? = nil) { + self.agentId = agentId + } + } + public var query: Operations.ListExecutions.Input.Query + /// - Remark: Generated from `#/paths/v1/executions/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CreateEventSource.Input.Headers - /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - name: - public init(name: Swift.String) { - self.name = name - } - public enum CodingKeys: String, CodingKey { - case name - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.name = try container.decode( - Swift.String.self, - forKey: .name - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "name" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/event-sources/POST/requestBody/content/application\/json`. - case json(Operations.CreateEventSource.Input.Body.JsonPayload) - } - public var body: Operations.CreateEventSource.Input.Body + public var headers: Operations.ListExecutions.Input.Headers /// Creates a new `Input`. /// /// - Parameters: + /// - query: /// - headers: - /// - body: public init( - headers: Operations.CreateEventSource.Input.Headers = .init(), - body: Operations.CreateEventSource.Input.Body + query: Operations.ListExecutions.Input.Query = .init(), + headers: Operations.ListExecutions.Input.Headers = .init() ) { + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content`. + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/address`. - public var address: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/createdAt`. - public var createdAt: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/id`. - public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/name`. - public var name: Swift.String - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/json/usedBy`. - public var usedBy: Swift.Int - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - address: - /// - createdAt: - /// - id: - /// - name: - /// - usedBy: - public init( - address: Swift.String, - createdAt: Swift.String, - id: Swift.String, - name: Swift.String, - usedBy: Swift.Int - ) { - self.address = address - self.createdAt = createdAt - self.id = id - self.name = name - self.usedBy = usedBy - } - public enum CodingKeys: String, CodingKey { - case address - case createdAt - case id - case name - case usedBy - } - } - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/201/content/application\/json`. - case json(Operations.CreateEventSource.Output.Created.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/200/content/application\/json`. + case json([Components.Schemas.Execution]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.CreateEventSource.Output.Created.Body.JsonPayload { + public var json: [Components.Schemas.Execution] { get throws { switch self { case let .json(body): @@ -40666,42 +45608,42 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.Created.Body - /// Creates a new `Created`. + public var body: Operations.ListExecutions.Output.Ok.Body + /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.Created.Body) { + public init(body: Operations.ListExecutions.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/201`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/200`. /// - /// HTTP response code: `201 created`. - case created(Operations.CreateEventSource.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `200 ok`. + case ok(Operations.ListExecutions.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.CreateEventSource.Output.Created { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListExecutions.Output.Ok { get throws { switch self { - case let .created(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40717,26 +45659,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.BadRequest.Body + public var body: Operations.ListExecutions.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.BadRequest.Body) { + public init(body: Operations.ListExecutions.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/400`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CreateEventSource.Output.BadRequest) + case badRequest(Operations.ListExecutions.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CreateEventSource.Output.BadRequest { + public var badRequest: Operations.ListExecutions.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -40750,9 +45692,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -40768,26 +45710,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.Unauthorized.Body + public var body: Operations.ListExecutions.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.Unauthorized.Body) { + public init(body: Operations.ListExecutions.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/401`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CreateEventSource.Output.Unauthorized) + case unauthorized(Operations.ListExecutions.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CreateEventSource.Output.Unauthorized { + public var unauthorized: Operations.ListExecutions.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -40801,9 +45743,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40819,26 +45761,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.NotFound.Body + public var body: Operations.ListExecutions.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.NotFound.Body) { + public init(body: Operations.ListExecutions.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/404`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CreateEventSource.Output.NotFound) + case notFound(Operations.ListExecutions.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CreateEventSource.Output.NotFound { + public var notFound: Operations.ListExecutions.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -40852,9 +45794,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40870,26 +45812,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.MethodNotAllowed.Body + public var body: Operations.ListExecutions.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListExecutions.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/405`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CreateEventSource.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListExecutions.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CreateEventSource.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListExecutions.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -40903,9 +45845,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -40921,26 +45863,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.Conflict.Body + public var body: Operations.ListExecutions.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.Conflict.Body) { + public init(body: Operations.ListExecutions.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/409`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CreateEventSource.Output.Conflict) + case conflict(Operations.ListExecutions.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CreateEventSource.Output.Conflict { + public var conflict: Operations.ListExecutions.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -40954,9 +45896,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -40972,26 +45914,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.ContentTooLarge.Body + public var body: Operations.ListExecutions.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.ContentTooLarge.Body) { + public init(body: Operations.ListExecutions.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/413`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CreateEventSource.Output.ContentTooLarge) + case contentTooLarge(Operations.ListExecutions.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CreateEventSource.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListExecutions.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -41005,9 +45947,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41023,26 +45965,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.InternalServerError.Body + public var body: Operations.ListExecutions.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.InternalServerError.Body) { + public init(body: Operations.ListExecutions.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/500`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CreateEventSource.Output.InternalServerError) + case internalServerError(Operations.ListExecutions.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CreateEventSource.Output.InternalServerError { + public var internalServerError: Operations.ListExecutions.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -41056,9 +45998,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/executions/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41074,26 +46016,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateEventSource.Output.ServiceUnavailable.Body + public var body: Operations.ListExecutions.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateEventSource.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListExecutions.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/event-sources/post(createEventSource)/responses/503`. + /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CreateEventSource.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListExecutions.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CreateEventSource.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListExecutions.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -41143,91 +46085,104 @@ public enum Operations { } } } - /// Deletes the source on the event relay and in Crumble; its address stops working. 409 while an automation uses it. + /// The account's machine accounts: GitHub users made for bots. A bot acts as its machine account wherever none of its GitHub Apps does. /// - /// - Remark: HTTP `DELETE /v1/event-sources/{id}`. - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)`. - public enum DeleteEventSource { - public static let id: Swift.String = "deleteEventSource" + /// - Remark: HTTP `GET /v1/github-accounts`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)`. + public enum ListGithubAccounts { + public static let id: Swift.String = "listGithubAccounts" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.DeleteEventSource.Input.Path - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/header`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeleteEventSource.Input.Headers + public var headers: Operations.ListGithubAccounts.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: - public init( - path: Operations.DeleteEventSource.Input.Path, - headers: Operations.DeleteEventSource.Input.Headers = .init() - ) { - self.path = path + public init(headers: Operations.ListGithubAccounts.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content/json/accounts`. + public var accounts: [Components.Schemas.GitHubAccount] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - accounts: + public init(accounts: [Components.Schemas.GitHubAccount]) { + self.accounts = accounts + } + public enum CodingKeys: String, CodingKey { + case accounts + } + } + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content/application\/json`. + case json(Operations.ListGithubAccounts.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ListGithubAccounts.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListGithubAccounts.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListGithubAccounts.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteEventSource.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/204`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ListGithubAccounts.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteEventSource.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListGithubAccounts.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41243,26 +46198,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.BadRequest.Body + public var body: Operations.ListGithubAccounts.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.BadRequest.Body) { + public init(body: Operations.ListGithubAccounts.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteEventSource.Output.BadRequest) + case badRequest(Operations.ListGithubAccounts.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteEventSource.Output.BadRequest { + public var badRequest: Operations.ListGithubAccounts.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -41276,9 +46231,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -41294,26 +46249,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.Unauthorized.Body + public var body: Operations.ListGithubAccounts.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.Unauthorized.Body) { + public init(body: Operations.ListGithubAccounts.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteEventSource.Output.Unauthorized) + case unauthorized(Operations.ListGithubAccounts.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteEventSource.Output.Unauthorized { + public var unauthorized: Operations.ListGithubAccounts.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -41327,9 +46282,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41345,26 +46300,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.NotFound.Body + public var body: Operations.ListGithubAccounts.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.NotFound.Body) { + public init(body: Operations.ListGithubAccounts.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteEventSource.Output.NotFound) + case notFound(Operations.ListGithubAccounts.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteEventSource.Output.NotFound { + public var notFound: Operations.ListGithubAccounts.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -41378,9 +46333,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41396,26 +46351,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.MethodNotAllowed.Body + public var body: Operations.ListGithubAccounts.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListGithubAccounts.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteEventSource.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListGithubAccounts.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteEventSource.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListGithubAccounts.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -41429,9 +46384,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41447,26 +46402,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.Conflict.Body + public var body: Operations.ListGithubAccounts.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.Conflict.Body) { + public init(body: Operations.ListGithubAccounts.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteEventSource.Output.Conflict) + case conflict(Operations.ListGithubAccounts.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteEventSource.Output.Conflict { + public var conflict: Operations.ListGithubAccounts.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -41480,9 +46435,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -41498,26 +46453,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.ContentTooLarge.Body + public var body: Operations.ListGithubAccounts.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.ContentTooLarge.Body) { + public init(body: Operations.ListGithubAccounts.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteEventSource.Output.ContentTooLarge) + case contentTooLarge(Operations.ListGithubAccounts.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteEventSource.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListGithubAccounts.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -41531,9 +46486,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41549,26 +46504,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.InternalServerError.Body + public var body: Operations.ListGithubAccounts.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.InternalServerError.Body) { + public init(body: Operations.ListGithubAccounts.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteEventSource.Output.InternalServerError) + case internalServerError(Operations.ListGithubAccounts.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteEventSource.Output.InternalServerError { + public var internalServerError: Operations.ListGithubAccounts.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -41582,9 +46537,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/event-sources/{id}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41600,26 +46555,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteEventSource.Output.ServiceUnavailable.Body + public var body: Operations.ListGithubAccounts.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteEventSource.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListGithubAccounts.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/event-sources/{id}/delete(deleteEventSource)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteEventSource.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListGithubAccounts.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteEventSource.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListGithubAccounts.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -41669,73 +46624,150 @@ public enum Operations { } } } - /// Server-sent events. Each activity event carries a ReplyEvent or ChatPreviewEvent JSON object in data. Each learned event carries a LearnedEvent: what a bot's review of one turn changed; GET /v1/agents/{id}/reviews lists them durably. Current chat previews replay on connection; finished replies and learned events are not replayed. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. No Last-Event-ID replay. + /// Adds the GitHub user a personal access token signs in as. 400 when GitHub refuses the token; 409 when the user is already added. /// - /// - Remark: HTTP `GET /v1/events`. - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)`. - public enum StreamActivityEvents { - public static let id: Swift.String = "streamActivityEvents" + /// - Remark: HTTP `POST /v1/github-accounts`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)`. + public enum AddGithubAccount { + public static let id: Swift.String = "addGithubAccount" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/header`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.StreamActivityEvents.Input.Headers + public var headers: Operations.AddGithubAccount.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference`. + public struct ReferencePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference/passwordManager`. + @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _1password = "1password" + case bitwarden = "bitwarden" + } + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference/passwordManager`. + public var passwordManager: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference/reference`. + public var reference: Swift.String + /// Creates a new `ReferencePayload`. + /// + /// - Parameters: + /// - passwordManager: + /// - reference: + public init( + passwordManager: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload, + reference: Swift.String + ) { + self.passwordManager = passwordManager + self.reference = reference + } + public enum CodingKeys: String, CodingKey { + case passwordManager + case reference + } + } + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference`. + public var reference: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload? + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/value`. + public var value: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - reference: + /// - value: + public init( + reference: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload? = nil, + value: Swift.String? = nil + ) { + self.reference = reference + self.value = value + } + public enum CodingKeys: String, CodingKey { + case reference + case value + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.reference = try container.decodeIfPresent( + Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload.self, + forKey: .reference + ) + self.value = try container.decodeIfPresent( + Swift.String.self, + forKey: .value + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "reference", + "value" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/content/application\/json`. + case json(Operations.AddGithubAccount.Input.Body.JsonPayload) + } + public var body: Operations.AddGithubAccount.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - headers: - public init(headers: Operations.StreamActivityEvents.Input.Headers = .init()) { + /// - body: + public init( + headers: Operations.AddGithubAccount.Input.Headers = .init(), + body: Operations.AddGithubAccount.Input.Body + ) { self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/200/content/text\/event-stream`. - case textEventStream(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.textEventStream`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/200/content/application\/json`. + case json(Components.Schemas.GitHubAccount) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Throws: An error if `self` is not `.textEventStream`. - /// - SeeAlso: `.textEventStream`. - public var textEventStream: OpenAPIRuntime.HTTPBody { + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.GitHubAccount { get throws { switch self { - case let .textEventStream(body): + case let .json(body): return body } } } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.Ok.Body + public var body: Operations.AddGithubAccount.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.Ok.Body) { + public init(body: Operations.AddGithubAccount.Output.Ok.Body) { self.body = body } } - /// SSE stream, not a JSON array + /// Success /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.StreamActivityEvents.Output.Ok) + case ok(Operations.AddGithubAccount.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.StreamActivityEvents.Output.Ok { + public var ok: Operations.AddGithubAccount.Output.Ok { get throws { switch self { case let .ok(response): @@ -41749,9 +46781,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41767,26 +46799,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.BadRequest.Body + public var body: Operations.AddGithubAccount.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.BadRequest.Body) { + public init(body: Operations.AddGithubAccount.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.StreamActivityEvents.Output.BadRequest) + case badRequest(Operations.AddGithubAccount.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.StreamActivityEvents.Output.BadRequest { + public var badRequest: Operations.AddGithubAccount.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -41800,9 +46832,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -41818,26 +46850,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.Unauthorized.Body + public var body: Operations.AddGithubAccount.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.Unauthorized.Body) { + public init(body: Operations.AddGithubAccount.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.StreamActivityEvents.Output.Unauthorized) + case unauthorized(Operations.AddGithubAccount.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.StreamActivityEvents.Output.Unauthorized { + public var unauthorized: Operations.AddGithubAccount.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -41851,9 +46883,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41869,26 +46901,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.NotFound.Body + public var body: Operations.AddGithubAccount.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.NotFound.Body) { + public init(body: Operations.AddGithubAccount.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.StreamActivityEvents.Output.NotFound) + case notFound(Operations.AddGithubAccount.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.StreamActivityEvents.Output.NotFound { + public var notFound: Operations.AddGithubAccount.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -41902,9 +46934,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41920,26 +46952,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.MethodNotAllowed.Body + public var body: Operations.AddGithubAccount.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.MethodNotAllowed.Body) { + public init(body: Operations.AddGithubAccount.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.StreamActivityEvents.Output.MethodNotAllowed) + case methodNotAllowed(Operations.AddGithubAccount.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.StreamActivityEvents.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.AddGithubAccount.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -41953,9 +46985,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -41971,26 +47003,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.Conflict.Body + public var body: Operations.AddGithubAccount.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.Conflict.Body) { + public init(body: Operations.AddGithubAccount.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.StreamActivityEvents.Output.Conflict) + case conflict(Operations.AddGithubAccount.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.StreamActivityEvents.Output.Conflict { + public var conflict: Operations.AddGithubAccount.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -42004,9 +47036,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -42022,26 +47054,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.ContentTooLarge.Body + public var body: Operations.AddGithubAccount.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.ContentTooLarge.Body) { + public init(body: Operations.AddGithubAccount.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.StreamActivityEvents.Output.ContentTooLarge) + case contentTooLarge(Operations.AddGithubAccount.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.StreamActivityEvents.Output.ContentTooLarge { + public var contentTooLarge: Operations.AddGithubAccount.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -42055,9 +47087,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42073,26 +47105,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.InternalServerError.Body + public var body: Operations.AddGithubAccount.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.InternalServerError.Body) { + public init(body: Operations.AddGithubAccount.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.StreamActivityEvents.Output.InternalServerError) + case internalServerError(Operations.AddGithubAccount.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.StreamActivityEvents.Output.InternalServerError { + public var internalServerError: Operations.AddGithubAccount.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -42106,9 +47138,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/events/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42124,26 +47156,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamActivityEvents.Output.ServiceUnavailable.Body + public var body: Operations.AddGithubAccount.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamActivityEvents.Output.ServiceUnavailable.Body) { + public init(body: Operations.AddGithubAccount.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/events/get(streamActivityEvents)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.StreamActivityEvents.Output.ServiceUnavailable) + case serviceUnavailable(Operations.AddGithubAccount.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.StreamActivityEvents.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.AddGithubAccount.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -42162,14 +47194,11 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { - case textEventStream case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { - case "text/event-stream": - self = .textEventStream case "application/json": self = .json case "text/plain": @@ -42182,8 +47211,6 @@ public enum Operations { switch self { case let .other(string): return string - case .textEventStream: - return "text/event-stream" case .json: return "application/json" case .plainText: @@ -42192,112 +47219,97 @@ public enum Operations { } public static var allCases: [Self] { [ - .textEventStream, .json, .plainText ] } } } - /// - Remark: HTTP `GET /v1/executions`. - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)`. - public enum ListExecutions { - public static let id: Swift.String = "listExecutions" + /// Forgets the machine account and its token, and takes GH_TOKEN from bots left without an installed App. The user stays on GitHub. + /// + /// - Remark: HTTP `DELETE /v1/github-accounts/{id}`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)`. + public enum DeleteGithubAccount { + public static let id: Swift.String = "deleteGithubAccount" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/query/agentId`. - public var agentId: Swift.String? - /// Creates a new `Query`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/path/id`. + public var id: Swift.String + /// Creates a new `Path`. /// /// - Parameters: - /// - agentId: - public init(agentId: Swift.String? = nil) { - self.agentId = agentId + /// - id: + public init(id: Swift.String) { + self.id = id } } - public var query: Operations.ListExecutions.Input.Query - /// - Remark: Generated from `#/paths/v1/executions/GET/header`. + public var path: Operations.DeleteGithubAccount.Input.Path + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListExecutions.Input.Headers + public var headers: Operations.DeleteGithubAccount.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - query: + /// - path: /// - headers: public init( - query: Operations.ListExecutions.Input.Query = .init(), - headers: Operations.ListExecutions.Input.Headers = .init() + path: Operations.DeleteGithubAccount.Input.Path, + headers: Operations.DeleteGithubAccount.Input.Headers = .init() ) { - self.query = query + self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/200/content/application\/json`. - case json([Components.Schemas.Execution]) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: [Components.Schemas.Execution] { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.ListExecutions.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.ListExecutions.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteGithubAccount.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.ListExecutions.Output.Ok { + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteGithubAccount.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42313,26 +47325,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.BadRequest.Body + public var body: Operations.DeleteGithubAccount.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.BadRequest.Body) { + public init(body: Operations.DeleteGithubAccount.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListExecutions.Output.BadRequest) + case badRequest(Operations.DeleteGithubAccount.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListExecutions.Output.BadRequest { + public var badRequest: Operations.DeleteGithubAccount.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -42346,9 +47358,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -42364,26 +47376,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.Unauthorized.Body + public var body: Operations.DeleteGithubAccount.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.Unauthorized.Body) { + public init(body: Operations.DeleteGithubAccount.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListExecutions.Output.Unauthorized) + case unauthorized(Operations.DeleteGithubAccount.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListExecutions.Output.Unauthorized { + public var unauthorized: Operations.DeleteGithubAccount.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -42397,9 +47409,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42415,26 +47427,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.NotFound.Body + public var body: Operations.DeleteGithubAccount.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.NotFound.Body) { + public init(body: Operations.DeleteGithubAccount.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListExecutions.Output.NotFound) + case notFound(Operations.DeleteGithubAccount.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListExecutions.Output.NotFound { + public var notFound: Operations.DeleteGithubAccount.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -42448,9 +47460,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42466,26 +47478,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.MethodNotAllowed.Body + public var body: Operations.DeleteGithubAccount.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteGithubAccount.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListExecutions.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteGithubAccount.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListExecutions.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteGithubAccount.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -42499,9 +47511,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42517,26 +47529,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.Conflict.Body + public var body: Operations.DeleteGithubAccount.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.Conflict.Body) { + public init(body: Operations.DeleteGithubAccount.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListExecutions.Output.Conflict) + case conflict(Operations.DeleteGithubAccount.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListExecutions.Output.Conflict { + public var conflict: Operations.DeleteGithubAccount.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -42550,9 +47562,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -42568,26 +47580,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.ContentTooLarge.Body + public var body: Operations.DeleteGithubAccount.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteGithubAccount.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListExecutions.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteGithubAccount.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListExecutions.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteGithubAccount.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -42601,9 +47613,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42619,26 +47631,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.InternalServerError.Body + public var body: Operations.DeleteGithubAccount.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.InternalServerError.Body) { + public init(body: Operations.DeleteGithubAccount.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListExecutions.Output.InternalServerError) + case internalServerError(Operations.DeleteGithubAccount.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListExecutions.Output.InternalServerError { + public var internalServerError: Operations.DeleteGithubAccount.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -42652,9 +47664,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/executions/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42670,26 +47682,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListExecutions.Output.ServiceUnavailable.Body + public var body: Operations.DeleteGithubAccount.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListExecutions.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteGithubAccount.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/executions/get(listExecutions)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListExecutions.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteGithubAccount.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListExecutions.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteGithubAccount.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -42739,59 +47751,96 @@ public enum Operations { } } } - /// The account's machine accounts: GitHub users made for bots. A bot acts as its machine account wherever none of its GitHub Apps does. + /// Replaces the bots that act as the machine account, giving them GH_TOKEN. A bot acts as at most one; 409 when a bot already acts as another. /// - /// - Remark: HTTP `GET /v1/github-accounts`. - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)`. - public enum ListGithubAccounts { - public static let id: Swift.String = "listGithubAccounts" + /// - Remark: HTTP `PUT /v1/github-accounts/{id}/bots`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)`. + public enum SetGithubAccountBots { + public static let id: Swift.String = "setGithubAccountBots" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/header`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.SetGithubAccountBots.Input.Path + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListGithubAccounts.Input.Headers + public var headers: Operations.SetGithubAccountBots.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody/json/botIds`. + public var botIds: [Swift.String] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - botIds: + public init(botIds: [Swift.String]) { + self.botIds = botIds + } + public enum CodingKeys: String, CodingKey { + case botIds + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.botIds = try container.decode( + [Swift.String].self, + forKey: .botIds + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "botIds" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody/content/application\/json`. + case json(Operations.SetGithubAccountBots.Input.Body.JsonPayload) + } + public var body: Operations.SetGithubAccountBots.Input.Body /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: - public init(headers: Operations.ListGithubAccounts.Input.Headers = .init()) { + /// - body: + public init( + path: Operations.SetGithubAccountBots.Input.Path, + headers: Operations.SetGithubAccountBots.Input.Headers = .init(), + body: Operations.SetGithubAccountBots.Input.Body + ) { + self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content/json/accounts`. - public var accounts: [Components.Schemas.GitHubAccount] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - accounts: - public init(accounts: [Components.Schemas.GitHubAccount]) { - self.accounts = accounts - } - public enum CodingKeys: String, CodingKey { - case accounts - } - } - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/200/content/application\/json`. - case json(Operations.ListGithubAccounts.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.GitHubAccount) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ListGithubAccounts.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.GitHubAccount { get throws { switch self { case let .json(body): @@ -42801,26 +47850,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.Ok.Body + public var body: Operations.SetGithubAccountBots.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.Ok.Body) { + public init(body: Operations.SetGithubAccountBots.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListGithubAccounts.Output.Ok) + case ok(Operations.SetGithubAccountBots.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListGithubAccounts.Output.Ok { + public var ok: Operations.SetGithubAccountBots.Output.Ok { get throws { switch self { case let .ok(response): @@ -42834,9 +47883,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42852,26 +47901,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.BadRequest.Body + public var body: Operations.SetGithubAccountBots.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.BadRequest.Body) { + public init(body: Operations.SetGithubAccountBots.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListGithubAccounts.Output.BadRequest) + case badRequest(Operations.SetGithubAccountBots.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListGithubAccounts.Output.BadRequest { + public var badRequest: Operations.SetGithubAccountBots.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -42885,9 +47934,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -42903,26 +47952,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.Unauthorized.Body + public var body: Operations.SetGithubAccountBots.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.Unauthorized.Body) { + public init(body: Operations.SetGithubAccountBots.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListGithubAccounts.Output.Unauthorized) + case unauthorized(Operations.SetGithubAccountBots.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListGithubAccounts.Output.Unauthorized { + public var unauthorized: Operations.SetGithubAccountBots.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -42936,9 +47985,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -42954,26 +48003,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.NotFound.Body + public var body: Operations.SetGithubAccountBots.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.NotFound.Body) { + public init(body: Operations.SetGithubAccountBots.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListGithubAccounts.Output.NotFound) + case notFound(Operations.SetGithubAccountBots.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListGithubAccounts.Output.NotFound { + public var notFound: Operations.SetGithubAccountBots.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -42987,9 +48036,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43005,26 +48054,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.MethodNotAllowed.Body + public var body: Operations.SetGithubAccountBots.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.MethodNotAllowed.Body) { + public init(body: Operations.SetGithubAccountBots.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListGithubAccounts.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SetGithubAccountBots.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListGithubAccounts.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SetGithubAccountBots.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -43038,9 +48087,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43056,26 +48105,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.Conflict.Body + public var body: Operations.SetGithubAccountBots.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.Conflict.Body) { + public init(body: Operations.SetGithubAccountBots.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListGithubAccounts.Output.Conflict) + case conflict(Operations.SetGithubAccountBots.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListGithubAccounts.Output.Conflict { + public var conflict: Operations.SetGithubAccountBots.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -43089,9 +48138,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -43107,26 +48156,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.ContentTooLarge.Body + public var body: Operations.SetGithubAccountBots.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.ContentTooLarge.Body) { + public init(body: Operations.SetGithubAccountBots.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListGithubAccounts.Output.ContentTooLarge) + case contentTooLarge(Operations.SetGithubAccountBots.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListGithubAccounts.Output.ContentTooLarge { + public var contentTooLarge: Operations.SetGithubAccountBots.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -43140,9 +48189,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43158,26 +48207,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.InternalServerError.Body + public var body: Operations.SetGithubAccountBots.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.InternalServerError.Body) { + public init(body: Operations.SetGithubAccountBots.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListGithubAccounts.Output.InternalServerError) + case internalServerError(Operations.SetGithubAccountBots.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListGithubAccounts.Output.InternalServerError { + public var internalServerError: Operations.SetGithubAccountBots.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -43191,9 +48240,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43209,26 +48258,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubAccounts.Output.ServiceUnavailable.Body + public var body: Operations.SetGithubAccountBots.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubAccounts.Output.ServiceUnavailable.Body) { + public init(body: Operations.SetGithubAccountBots.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-accounts/get(listGithubAccounts)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListGithubAccounts.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SetGithubAccountBots.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListGithubAccounts.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SetGithubAccountBots.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -43278,39 +48327,52 @@ public enum Operations { } } } - /// Adds the GitHub user a personal access token signs in as. 400 when GitHub refuses the token; 409 when the user is already added. + /// Replaces the machine account's token. 400 when GitHub refuses it or it signs in as another user. /// - /// - Remark: HTTP `POST /v1/github-accounts`. - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)`. - public enum AddGithubAccount { - public static let id: Swift.String = "addGithubAccount" + /// - Remark: HTTP `PUT /v1/github-accounts/{id}/token`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)`. + public enum SetGithubAccountToken { + public static let id: Swift.String = "setGithubAccountToken" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/header`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.SetGithubAccountToken.Input.Path + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.AddGithubAccount.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody`. + public var headers: Operations.SetGithubAccountToken.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference`. public struct ReferencePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference/passwordManager`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference/passwordManager`. @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { case _1password = "1password" case bitwarden = "bitwarden" } - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference/passwordManager`. - public var passwordManager: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference/reference`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference/passwordManager`. + public var passwordManager: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference/reference`. public var reference: Swift.String /// Creates a new `ReferencePayload`. /// @@ -43318,7 +48380,7 @@ public enum Operations { /// - passwordManager: /// - reference: public init( - passwordManager: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload, + passwordManager: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload, reference: Swift.String ) { self.passwordManager = passwordManager @@ -43329,9 +48391,9 @@ public enum Operations { case reference } } - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/reference`. - public var reference: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload? - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/json/value`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference`. + public var reference: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload? + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/value`. public var value: Swift.String? /// Creates a new `JsonPayload`. /// @@ -43339,7 +48401,7 @@ public enum Operations { /// - reference: /// - value: public init( - reference: Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload? = nil, + reference: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload? = nil, value: Swift.String? = nil ) { self.reference = reference @@ -43352,7 +48414,7 @@ public enum Operations { public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) self.reference = try container.decodeIfPresent( - Operations.AddGithubAccount.Input.Body.JsonPayload.ReferencePayload.self, + Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload.self, forKey: .reference ) self.value = try container.decodeIfPresent( @@ -43365,28 +48427,31 @@ public enum Operations { ]) } } - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/requestBody/content/application\/json`. - case json(Operations.AddGithubAccount.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/content/application\/json`. + case json(Operations.SetGithubAccountToken.Input.Body.JsonPayload) } - public var body: Operations.AddGithubAccount.Input.Body + public var body: Operations.SetGithubAccountToken.Input.Body /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: /// - body: public init( - headers: Operations.AddGithubAccount.Input.Headers = .init(), - body: Operations.AddGithubAccount.Input.Body + path: Operations.SetGithubAccountToken.Input.Path, + headers: Operations.SetGithubAccountToken.Input.Headers = .init(), + body: Operations.SetGithubAccountToken.Input.Body ) { + self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/200/content/application\/json`. case json(Components.Schemas.GitHubAccount) /// The associated value of the enum case if `self` is `.json`. /// @@ -43402,26 +48467,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.Ok.Body + public var body: Operations.SetGithubAccountToken.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.Ok.Body) { + public init(body: Operations.SetGithubAccountToken.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.AddGithubAccount.Output.Ok) + case ok(Operations.SetGithubAccountToken.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.AddGithubAccount.Output.Ok { + public var ok: Operations.SetGithubAccountToken.Output.Ok { get throws { switch self { case let .ok(response): @@ -43435,9 +48500,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43453,26 +48518,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.BadRequest.Body + public var body: Operations.SetGithubAccountToken.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.BadRequest.Body) { + public init(body: Operations.SetGithubAccountToken.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.AddGithubAccount.Output.BadRequest) + case badRequest(Operations.SetGithubAccountToken.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.AddGithubAccount.Output.BadRequest { + public var badRequest: Operations.SetGithubAccountToken.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -43486,9 +48551,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -43504,26 +48569,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.Unauthorized.Body + public var body: Operations.SetGithubAccountToken.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.Unauthorized.Body) { + public init(body: Operations.SetGithubAccountToken.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.AddGithubAccount.Output.Unauthorized) + case unauthorized(Operations.SetGithubAccountToken.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.AddGithubAccount.Output.Unauthorized { + public var unauthorized: Operations.SetGithubAccountToken.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -43537,9 +48602,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43555,26 +48620,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.NotFound.Body + public var body: Operations.SetGithubAccountToken.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.NotFound.Body) { + public init(body: Operations.SetGithubAccountToken.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.AddGithubAccount.Output.NotFound) + case notFound(Operations.SetGithubAccountToken.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.AddGithubAccount.Output.NotFound { + public var notFound: Operations.SetGithubAccountToken.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -43588,9 +48653,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43606,26 +48671,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.MethodNotAllowed.Body + public var body: Operations.SetGithubAccountToken.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.MethodNotAllowed.Body) { + public init(body: Operations.SetGithubAccountToken.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.AddGithubAccount.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SetGithubAccountToken.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.AddGithubAccount.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SetGithubAccountToken.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -43639,9 +48704,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43657,26 +48722,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.Conflict.Body + public var body: Operations.SetGithubAccountToken.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.Conflict.Body) { + public init(body: Operations.SetGithubAccountToken.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.AddGithubAccount.Output.Conflict) + case conflict(Operations.SetGithubAccountToken.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.AddGithubAccount.Output.Conflict { + public var conflict: Operations.SetGithubAccountToken.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -43690,9 +48755,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -43708,26 +48773,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.ContentTooLarge.Body + public var body: Operations.SetGithubAccountToken.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.ContentTooLarge.Body) { + public init(body: Operations.SetGithubAccountToken.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.AddGithubAccount.Output.ContentTooLarge) + case contentTooLarge(Operations.SetGithubAccountToken.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.AddGithubAccount.Output.ContentTooLarge { + public var contentTooLarge: Operations.SetGithubAccountToken.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -43741,9 +48806,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43759,26 +48824,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.InternalServerError.Body + public var body: Operations.SetGithubAccountToken.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.InternalServerError.Body) { + public init(body: Operations.SetGithubAccountToken.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.AddGithubAccount.Output.InternalServerError) + case internalServerError(Operations.SetGithubAccountToken.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.AddGithubAccount.Output.InternalServerError { + public var internalServerError: Operations.SetGithubAccountToken.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -43792,9 +48857,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43810,26 +48875,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.AddGithubAccount.Output.ServiceUnavailable.Body + public var body: Operations.SetGithubAccountToken.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.AddGithubAccount.Output.ServiceUnavailable.Body) { + public init(body: Operations.SetGithubAccountToken.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-accounts/post(addGithubAccount)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.AddGithubAccount.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SetGithubAccountToken.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.AddGithubAccount.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SetGithubAccountToken.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -43879,91 +48944,104 @@ public enum Operations { } } } - /// Forgets the machine account and its token, and takes GH_TOKEN from bots left without an installed App. The user stays on GitHub. + /// The account's GitHub Apps, each the GitHub identity its bots act through in one GitHub account's repositories. /// - /// - Remark: HTTP `DELETE /v1/github-accounts/{id}`. - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)`. - public enum DeleteGithubAccount { - public static let id: Swift.String = "deleteGithubAccount" + /// - Remark: HTTP `GET /v1/github-apps`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)`. + public enum ListGithubApps { + public static let id: Swift.String = "listGithubApps" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.DeleteGithubAccount.Input.Path - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeleteGithubAccount.Input.Headers + public var headers: Operations.ListGithubApps.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: - public init( - path: Operations.DeleteGithubAccount.Input.Path, - headers: Operations.DeleteGithubAccount.Input.Headers = .init() - ) { - self.path = path + public init(headers: Operations.ListGithubApps.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content/json/apps`. + public var apps: [Components.Schemas.GitHubApp] + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - apps: + public init(apps: [Components.Schemas.GitHubApp]) { + self.apps = apps + } + public enum CodingKeys: String, CodingKey { + case apps + } + } + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content/application\/json`. + case json(Operations.ListGithubApps.Output.Ok.Body.JsonPayload) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Operations.ListGithubApps.Output.Ok.Body.JsonPayload { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListGithubApps.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListGithubApps.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteGithubAccount.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/204`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ListGithubApps.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteGithubAccount.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListGithubApps.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -43979,26 +49057,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.BadRequest.Body + public var body: Operations.ListGithubApps.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.BadRequest.Body) { + public init(body: Operations.ListGithubApps.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteGithubAccount.Output.BadRequest) + case badRequest(Operations.ListGithubApps.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteGithubAccount.Output.BadRequest { + public var badRequest: Operations.ListGithubApps.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -44012,9 +49090,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -44030,26 +49108,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.Unauthorized.Body + public var body: Operations.ListGithubApps.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.Unauthorized.Body) { + public init(body: Operations.ListGithubApps.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteGithubAccount.Output.Unauthorized) + case unauthorized(Operations.ListGithubApps.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteGithubAccount.Output.Unauthorized { + public var unauthorized: Operations.ListGithubApps.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -44063,9 +49141,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44081,26 +49159,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.NotFound.Body + public var body: Operations.ListGithubApps.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.NotFound.Body) { + public init(body: Operations.ListGithubApps.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteGithubAccount.Output.NotFound) + case notFound(Operations.ListGithubApps.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteGithubAccount.Output.NotFound { + public var notFound: Operations.ListGithubApps.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -44114,9 +49192,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44132,26 +49210,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.MethodNotAllowed.Body + public var body: Operations.ListGithubApps.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListGithubApps.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteGithubAccount.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListGithubApps.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteGithubAccount.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListGithubApps.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -44165,9 +49243,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44183,26 +49261,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.Conflict.Body + public var body: Operations.ListGithubApps.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.Conflict.Body) { + public init(body: Operations.ListGithubApps.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteGithubAccount.Output.Conflict) + case conflict(Operations.ListGithubApps.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteGithubAccount.Output.Conflict { + public var conflict: Operations.ListGithubApps.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -44216,9 +49294,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -44234,26 +49312,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.ContentTooLarge.Body + public var body: Operations.ListGithubApps.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.ContentTooLarge.Body) { + public init(body: Operations.ListGithubApps.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteGithubAccount.Output.ContentTooLarge) + case contentTooLarge(Operations.ListGithubApps.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteGithubAccount.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListGithubApps.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -44267,9 +49345,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44285,26 +49363,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.InternalServerError.Body + public var body: Operations.ListGithubApps.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.InternalServerError.Body) { + public init(body: Operations.ListGithubApps.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteGithubAccount.Output.InternalServerError) + case internalServerError(Operations.ListGithubApps.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteGithubAccount.Output.InternalServerError { + public var internalServerError: Operations.ListGithubApps.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -44318,9 +49396,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44336,26 +49414,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubAccount.Output.ServiceUnavailable.Body + public var body: Operations.ListGithubApps.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubAccount.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListGithubApps.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/delete(deleteGithubAccount)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteGithubAccount.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListGithubApps.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteGithubAccount.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListGithubApps.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -44405,96 +49483,93 @@ public enum Operations { } } } - /// Replaces the bots that act as the machine account, giving them GH_TOKEN. A bot acts as at most one; 409 when a bot already acts as another. + /// Exchanges the code GitHub redirected back with for the App's keys, within an hour of starting. 400 for a stale or reused state. /// - /// - Remark: HTTP `PUT /v1/github-accounts/{id}/bots`. - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)`. - public enum SetGithubAccountBots { - public static let id: Swift.String = "setGithubAccountBots" + /// - Remark: HTTP `POST /v1/github-apps/complete`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)`. + public enum CompleteGithubApp { + public static let id: Swift.String = "completeGithubApp" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.SetGithubAccountBots.Input.Path - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SetGithubAccountBots.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody`. + public var headers: Operations.CompleteGithubApp.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody/json/botIds`. - public var botIds: [Swift.String] + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/json/code`. + public var code: Swift.String + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/json/state`. + public var state: Swift.String /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - botIds: - public init(botIds: [Swift.String]) { - self.botIds = botIds + /// - code: + /// - state: + public init( + code: Swift.String, + state: Swift.String + ) { + self.code = code + self.state = state } public enum CodingKeys: String, CodingKey { - case botIds + case code + case state } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.botIds = try container.decode( - [Swift.String].self, - forKey: .botIds + self.code = try container.decode( + Swift.String.self, + forKey: .code + ) + self.state = try container.decode( + Swift.String.self, + forKey: .state ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "botIds" + "code", + "state" ]) } } - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/requestBody/content/application\/json`. - case json(Operations.SetGithubAccountBots.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/content/application\/json`. + case json(Operations.CompleteGithubApp.Input.Body.JsonPayload) } - public var body: Operations.SetGithubAccountBots.Input.Body + public var body: Operations.CompleteGithubApp.Input.Body /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: /// - body: public init( - path: Operations.SetGithubAccountBots.Input.Path, - headers: Operations.SetGithubAccountBots.Input.Headers = .init(), - body: Operations.SetGithubAccountBots.Input.Body + headers: Operations.CompleteGithubApp.Input.Headers = .init(), + body: Operations.CompleteGithubApp.Input.Body ) { - self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.GitHubAccount) + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/200/content/application\/json`. + case json(Components.Schemas.GitHubApp) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.GitHubAccount { + public var json: Components.Schemas.GitHubApp { get throws { switch self { case let .json(body): @@ -44504,26 +49579,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.Ok.Body + public var body: Operations.CompleteGithubApp.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.Ok.Body) { + public init(body: Operations.CompleteGithubApp.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SetGithubAccountBots.Output.Ok) + case ok(Operations.CompleteGithubApp.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SetGithubAccountBots.Output.Ok { + public var ok: Operations.CompleteGithubApp.Output.Ok { get throws { switch self { case let .ok(response): @@ -44537,9 +49612,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44555,26 +49630,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.BadRequest.Body + public var body: Operations.CompleteGithubApp.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.BadRequest.Body) { + public init(body: Operations.CompleteGithubApp.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SetGithubAccountBots.Output.BadRequest) + case badRequest(Operations.CompleteGithubApp.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SetGithubAccountBots.Output.BadRequest { + public var badRequest: Operations.CompleteGithubApp.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -44588,9 +49663,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -44606,26 +49681,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.Unauthorized.Body + public var body: Operations.CompleteGithubApp.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.Unauthorized.Body) { + public init(body: Operations.CompleteGithubApp.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SetGithubAccountBots.Output.Unauthorized) + case unauthorized(Operations.CompleteGithubApp.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SetGithubAccountBots.Output.Unauthorized { + public var unauthorized: Operations.CompleteGithubApp.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -44639,9 +49714,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44657,26 +49732,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.NotFound.Body + public var body: Operations.CompleteGithubApp.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.NotFound.Body) { + public init(body: Operations.CompleteGithubApp.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SetGithubAccountBots.Output.NotFound) + case notFound(Operations.CompleteGithubApp.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SetGithubAccountBots.Output.NotFound { + public var notFound: Operations.CompleteGithubApp.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -44690,9 +49765,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44708,26 +49783,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.MethodNotAllowed.Body + public var body: Operations.CompleteGithubApp.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.MethodNotAllowed.Body) { + public init(body: Operations.CompleteGithubApp.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SetGithubAccountBots.Output.MethodNotAllowed) + case methodNotAllowed(Operations.CompleteGithubApp.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SetGithubAccountBots.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.CompleteGithubApp.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -44741,9 +49816,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44759,26 +49834,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.Conflict.Body + public var body: Operations.CompleteGithubApp.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.Conflict.Body) { + public init(body: Operations.CompleteGithubApp.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SetGithubAccountBots.Output.Conflict) + case conflict(Operations.CompleteGithubApp.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SetGithubAccountBots.Output.Conflict { + public var conflict: Operations.CompleteGithubApp.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -44792,9 +49867,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -44810,26 +49885,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.ContentTooLarge.Body + public var body: Operations.CompleteGithubApp.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.ContentTooLarge.Body) { + public init(body: Operations.CompleteGithubApp.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SetGithubAccountBots.Output.ContentTooLarge) + case contentTooLarge(Operations.CompleteGithubApp.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SetGithubAccountBots.Output.ContentTooLarge { + public var contentTooLarge: Operations.CompleteGithubApp.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -44843,9 +49918,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44861,26 +49936,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.InternalServerError.Body + public var body: Operations.CompleteGithubApp.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.InternalServerError.Body) { + public init(body: Operations.CompleteGithubApp.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SetGithubAccountBots.Output.InternalServerError) + case internalServerError(Operations.CompleteGithubApp.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SetGithubAccountBots.Output.InternalServerError { + public var internalServerError: Operations.CompleteGithubApp.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -44894,9 +49969,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/bots/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -44912,26 +49987,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountBots.Output.ServiceUnavailable.Body + public var body: Operations.CompleteGithubApp.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountBots.Output.ServiceUnavailable.Body) { + public init(body: Operations.CompleteGithubApp.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/bots/put(setGithubAccountBots)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SetGithubAccountBots.Output.ServiceUnavailable) + case serviceUnavailable(Operations.CompleteGithubApp.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SetGithubAccountBots.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.CompleteGithubApp.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -44981,137 +50056,127 @@ public enum Operations { } } } - /// Replaces the machine account's token. 400 when GitHub refuses it or it signs in as another user. + /// Starts creating a private GitHub App. The client posts `manifest` as a form field to `url`; GitHub then sends the owner to `{origin}/github-app/callback` with a code and state. /// - /// - Remark: HTTP `PUT /v1/github-accounts/{id}/token`. - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)`. - public enum SetGithubAccountToken { - public static let id: Swift.String = "setGithubAccountToken" + /// - Remark: HTTP `POST /v1/github-apps/manifest`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)`. + public enum CreateGithubAppManifest { + public static let id: Swift.String = "createGithubAppManifest" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.SetGithubAccountToken.Input.Path - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SetGithubAccountToken.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody`. + public var headers: Operations.CreateGithubAppManifest.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference`. - public struct ReferencePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference/passwordManager`. - @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _1password = "1password" - case bitwarden = "bitwarden" - } - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference/passwordManager`. - public var passwordManager: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference/reference`. - public var reference: Swift.String - /// Creates a new `ReferencePayload`. - /// - /// - Parameters: - /// - passwordManager: - /// - reference: - public init( - passwordManager: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload, - reference: Swift.String - ) { - self.passwordManager = passwordManager - self.reference = reference - } - public enum CodingKeys: String, CodingKey { - case passwordManager - case reference - } - } - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/reference`. - public var reference: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload? - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/json/value`. - public var value: Swift.String? + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json/name`. + public var name: Swift.String + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json/organization`. + public var organization: Swift.String? + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json/origin`. + public var origin: Swift.String /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - reference: - /// - value: + /// - name: + /// - organization: + /// - origin: public init( - reference: Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload? = nil, - value: Swift.String? = nil + name: Swift.String, + organization: Swift.String? = nil, + origin: Swift.String ) { - self.reference = reference - self.value = value + self.name = name + self.organization = organization + self.origin = origin } public enum CodingKeys: String, CodingKey { - case reference - case value + case name + case organization + case origin } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.reference = try container.decodeIfPresent( - Operations.SetGithubAccountToken.Input.Body.JsonPayload.ReferencePayload.self, - forKey: .reference + self.name = try container.decode( + Swift.String.self, + forKey: .name ) - self.value = try container.decodeIfPresent( + self.organization = try container.decodeIfPresent( Swift.String.self, - forKey: .value + forKey: .organization + ) + self.origin = try container.decode( + Swift.String.self, + forKey: .origin ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "reference", - "value" + "name", + "organization", + "origin" ]) } } - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/requestBody/content/application\/json`. - case json(Operations.SetGithubAccountToken.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/content/application\/json`. + case json(Operations.CreateGithubAppManifest.Input.Body.JsonPayload) } - public var body: Operations.SetGithubAccountToken.Input.Body + public var body: Operations.CreateGithubAppManifest.Input.Body /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: /// - body: public init( - path: Operations.SetGithubAccountToken.Input.Path, - headers: Operations.SetGithubAccountToken.Input.Headers = .init(), - body: Operations.SetGithubAccountToken.Input.Body + headers: Operations.CreateGithubAppManifest.Input.Headers = .init(), + body: Operations.CreateGithubAppManifest.Input.Body ) { - self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.GitHubAccount) + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/json/manifest`. + public var manifest: Swift.String + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/json/url`. + public var url: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - manifest: + /// - url: + public init( + manifest: Swift.String, + url: Swift.String + ) { + self.manifest = manifest + self.url = url + } + public enum CodingKeys: String, CodingKey { + case manifest + case url + } + } + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/application\/json`. + case json(Operations.CreateGithubAppManifest.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.GitHubAccount { + public var json: Operations.CreateGithubAppManifest.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -45121,26 +50186,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.Ok.Body + public var body: Operations.CreateGithubAppManifest.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.Ok.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SetGithubAccountToken.Output.Ok) + case ok(Operations.CreateGithubAppManifest.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SetGithubAccountToken.Output.Ok { + public var ok: Operations.CreateGithubAppManifest.Output.Ok { get throws { switch self { case let .ok(response): @@ -45154,9 +50219,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45172,26 +50237,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.BadRequest.Body + public var body: Operations.CreateGithubAppManifest.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.BadRequest.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SetGithubAccountToken.Output.BadRequest) + case badRequest(Operations.CreateGithubAppManifest.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SetGithubAccountToken.Output.BadRequest { + public var badRequest: Operations.CreateGithubAppManifest.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -45205,9 +50270,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -45223,26 +50288,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.Unauthorized.Body + public var body: Operations.CreateGithubAppManifest.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.Unauthorized.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SetGithubAccountToken.Output.Unauthorized) + case unauthorized(Operations.CreateGithubAppManifest.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SetGithubAccountToken.Output.Unauthorized { + public var unauthorized: Operations.CreateGithubAppManifest.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -45256,9 +50321,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45274,26 +50339,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.NotFound.Body + public var body: Operations.CreateGithubAppManifest.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.NotFound.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SetGithubAccountToken.Output.NotFound) + case notFound(Operations.CreateGithubAppManifest.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SetGithubAccountToken.Output.NotFound { + public var notFound: Operations.CreateGithubAppManifest.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -45307,9 +50372,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45325,26 +50390,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.MethodNotAllowed.Body + public var body: Operations.CreateGithubAppManifest.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.MethodNotAllowed.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SetGithubAccountToken.Output.MethodNotAllowed) + case methodNotAllowed(Operations.CreateGithubAppManifest.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SetGithubAccountToken.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.CreateGithubAppManifest.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -45358,9 +50423,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45376,26 +50441,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.Conflict.Body + public var body: Operations.CreateGithubAppManifest.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.Conflict.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SetGithubAccountToken.Output.Conflict) + case conflict(Operations.CreateGithubAppManifest.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SetGithubAccountToken.Output.Conflict { + public var conflict: Operations.CreateGithubAppManifest.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -45409,9 +50474,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -45427,26 +50492,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.ContentTooLarge.Body + public var body: Operations.CreateGithubAppManifest.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.ContentTooLarge.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SetGithubAccountToken.Output.ContentTooLarge) + case contentTooLarge(Operations.CreateGithubAppManifest.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SetGithubAccountToken.Output.ContentTooLarge { + public var contentTooLarge: Operations.CreateGithubAppManifest.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -45460,9 +50525,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45478,26 +50543,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.InternalServerError.Body + public var body: Operations.CreateGithubAppManifest.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.InternalServerError.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SetGithubAccountToken.Output.InternalServerError) + case internalServerError(Operations.CreateGithubAppManifest.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SetGithubAccountToken.Output.InternalServerError { + public var internalServerError: Operations.CreateGithubAppManifest.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -45511,9 +50576,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-accounts/{id}/token/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45529,26 +50594,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAccountToken.Output.ServiceUnavailable.Body + public var body: Operations.CreateGithubAppManifest.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAccountToken.Output.ServiceUnavailable.Body) { + public init(body: Operations.CreateGithubAppManifest.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-accounts/{id}/token/put(setGithubAccountToken)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SetGithubAccountToken.Output.ServiceUnavailable) + case serviceUnavailable(Operations.CreateGithubAppManifest.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SetGithubAccountToken.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.CreateGithubAppManifest.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -45598,59 +50663,93 @@ public enum Operations { } } } - /// The account's GitHub Apps, each the GitHub identity its bots act through in one GitHub account's repositories. + /// Exchanges the code GitHub sent the owner back with for the owner's tokens, within ten minutes of starting. 400 for a stale or reused state or a refused sign-in. /// - /// - Remark: HTTP `GET /v1/github-apps`. - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)`. - public enum ListGithubApps { - public static let id: Swift.String = "listGithubApps" + /// - Remark: HTTP `POST /v1/github-apps/sign-in/complete`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)`. + public enum CompleteGithubAppSignIn { + public static let id: Swift.String = "completeGithubAppSignIn" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListGithubApps.Input.Headers + public var headers: Operations.CompleteGithubAppSignIn.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/json/code`. + public var code: Swift.String + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/json/state`. + public var state: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - code: + /// - state: + public init( + code: Swift.String, + state: Swift.String + ) { + self.code = code + self.state = state + } + public enum CodingKeys: String, CodingKey { + case code + case state + } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.code = try container.decode( + Swift.String.self, + forKey: .code + ) + self.state = try container.decode( + Swift.String.self, + forKey: .state + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "code", + "state" + ]) + } + } + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/content/application\/json`. + case json(Operations.CompleteGithubAppSignIn.Input.Body.JsonPayload) + } + public var body: Operations.CompleteGithubAppSignIn.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - headers: - public init(headers: Operations.ListGithubApps.Input.Headers = .init()) { + /// - body: + public init( + headers: Operations.CompleteGithubAppSignIn.Input.Headers = .init(), + body: Operations.CompleteGithubAppSignIn.Input.Body + ) { self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content/json/apps`. - public var apps: [Components.Schemas.GitHubApp] - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - apps: - public init(apps: [Components.Schemas.GitHubApp]) { - self.apps = apps - } - public enum CodingKeys: String, CodingKey { - case apps - } - } - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/200/content/application\/json`. - case json(Operations.ListGithubApps.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/200/content/application\/json`. + case json(Components.Schemas.GitHubApp) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.ListGithubApps.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.GitHubApp { get throws { switch self { case let .json(body): @@ -45660,26 +50759,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.Ok.Body + public var body: Operations.CompleteGithubAppSignIn.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.Ok.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListGithubApps.Output.Ok) + case ok(Operations.CompleteGithubAppSignIn.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListGithubApps.Output.Ok { + public var ok: Operations.CompleteGithubAppSignIn.Output.Ok { get throws { switch self { case let .ok(response): @@ -45693,9 +50792,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45711,26 +50810,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.BadRequest.Body + public var body: Operations.CompleteGithubAppSignIn.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.BadRequest.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListGithubApps.Output.BadRequest) + case badRequest(Operations.CompleteGithubAppSignIn.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListGithubApps.Output.BadRequest { + public var badRequest: Operations.CompleteGithubAppSignIn.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -45744,9 +50843,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -45762,26 +50861,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.Unauthorized.Body + public var body: Operations.CompleteGithubAppSignIn.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.Unauthorized.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListGithubApps.Output.Unauthorized) + case unauthorized(Operations.CompleteGithubAppSignIn.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListGithubApps.Output.Unauthorized { + public var unauthorized: Operations.CompleteGithubAppSignIn.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -45795,9 +50894,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45813,26 +50912,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.NotFound.Body + public var body: Operations.CompleteGithubAppSignIn.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.NotFound.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListGithubApps.Output.NotFound) + case notFound(Operations.CompleteGithubAppSignIn.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListGithubApps.Output.NotFound { + public var notFound: Operations.CompleteGithubAppSignIn.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -45846,9 +50945,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45864,26 +50963,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.MethodNotAllowed.Body + public var body: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.MethodNotAllowed.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListGithubApps.Output.MethodNotAllowed) + case methodNotAllowed(Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListGithubApps.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -45897,9 +50996,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -45915,26 +51014,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.Conflict.Body + public var body: Operations.CompleteGithubAppSignIn.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.Conflict.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListGithubApps.Output.Conflict) + case conflict(Operations.CompleteGithubAppSignIn.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListGithubApps.Output.Conflict { + public var conflict: Operations.CompleteGithubAppSignIn.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -45948,9 +51047,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -45966,26 +51065,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.ContentTooLarge.Body + public var body: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.ContentTooLarge.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListGithubApps.Output.ContentTooLarge) + case contentTooLarge(Operations.CompleteGithubAppSignIn.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListGithubApps.Output.ContentTooLarge { + public var contentTooLarge: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -45999,9 +51098,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46017,26 +51116,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.InternalServerError.Body + public var body: Operations.CompleteGithubAppSignIn.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.InternalServerError.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListGithubApps.Output.InternalServerError) + case internalServerError(Operations.CompleteGithubAppSignIn.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListGithubApps.Output.InternalServerError { + public var internalServerError: Operations.CompleteGithubAppSignIn.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -46050,9 +51149,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46068,26 +51167,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGithubApps.Output.ServiceUnavailable.Body + public var body: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGithubApps.Output.ServiceUnavailable.Body) { + public init(body: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/get(listGithubApps)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListGithubApps.Output.ServiceUnavailable) + case serviceUnavailable(Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListGithubApps.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -46137,138 +51236,91 @@ public enum Operations { } } } - /// Exchanges the code GitHub redirected back with for the App's keys, within an hour of starting. 400 for a stale or reused state. + /// Forgets the App, signs the owner out of it, and takes GH_TOKEN from bots left without an installed App. The App stays on GitHub until the owner deletes it there. /// - /// - Remark: HTTP `POST /v1/github-apps/complete`. - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)`. - public enum CompleteGithubApp { - public static let id: Swift.String = "completeGithubApp" + /// - Remark: HTTP `DELETE /v1/github-apps/{id}`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)`. + public enum DeleteGithubApp { + public static let id: Swift.String = "deleteGithubApp" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.DeleteGithubApp.Input.Path + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CompleteGithubApp.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/json/code`. - public var code: Swift.String - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/json/state`. - public var state: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - code: - /// - state: - public init( - code: Swift.String, - state: Swift.String - ) { - self.code = code - self.state = state - } - public enum CodingKeys: String, CodingKey { - case code - case state - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.code = try container.decode( - Swift.String.self, - forKey: .code - ) - self.state = try container.decode( - Swift.String.self, - forKey: .state - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "code", - "state" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/requestBody/content/application\/json`. - case json(Operations.CompleteGithubApp.Input.Body.JsonPayload) - } - public var body: Operations.CompleteGithubApp.Input.Body + public var headers: Operations.DeleteGithubApp.Input.Headers /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: - /// - body: public init( - headers: Operations.CompleteGithubApp.Input.Headers = .init(), - body: Operations.CompleteGithubApp.Input.Body + path: Operations.DeleteGithubApp.Input.Path, + headers: Operations.DeleteGithubApp.Input.Headers = .init() ) { + self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GitHubApp) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GitHubApp { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.CompleteGithubApp.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteGithubApp.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.CompleteGithubApp.Output.Ok { + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteGithubApp.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46284,26 +51336,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.BadRequest.Body + public var body: Operations.DeleteGithubApp.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.BadRequest.Body) { + public init(body: Operations.DeleteGithubApp.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CompleteGithubApp.Output.BadRequest) + case badRequest(Operations.DeleteGithubApp.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CompleteGithubApp.Output.BadRequest { + public var badRequest: Operations.DeleteGithubApp.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -46317,9 +51369,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -46335,26 +51387,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.Unauthorized.Body + public var body: Operations.DeleteGithubApp.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.Unauthorized.Body) { + public init(body: Operations.DeleteGithubApp.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CompleteGithubApp.Output.Unauthorized) + case unauthorized(Operations.DeleteGithubApp.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CompleteGithubApp.Output.Unauthorized { + public var unauthorized: Operations.DeleteGithubApp.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -46368,9 +51420,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46386,26 +51438,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.NotFound.Body + public var body: Operations.DeleteGithubApp.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.NotFound.Body) { + public init(body: Operations.DeleteGithubApp.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CompleteGithubApp.Output.NotFound) + case notFound(Operations.DeleteGithubApp.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CompleteGithubApp.Output.NotFound { + public var notFound: Operations.DeleteGithubApp.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -46419,9 +51471,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46437,26 +51489,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.MethodNotAllowed.Body + public var body: Operations.DeleteGithubApp.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteGithubApp.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CompleteGithubApp.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteGithubApp.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CompleteGithubApp.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteGithubApp.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -46470,9 +51522,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46488,26 +51540,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.Conflict.Body + public var body: Operations.DeleteGithubApp.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.Conflict.Body) { + public init(body: Operations.DeleteGithubApp.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CompleteGithubApp.Output.Conflict) + case conflict(Operations.DeleteGithubApp.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CompleteGithubApp.Output.Conflict { + public var conflict: Operations.DeleteGithubApp.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -46521,9 +51573,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -46539,26 +51591,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.ContentTooLarge.Body + public var body: Operations.DeleteGithubApp.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteGithubApp.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CompleteGithubApp.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteGithubApp.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CompleteGithubApp.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteGithubApp.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -46572,9 +51624,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46590,26 +51642,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.InternalServerError.Body + public var body: Operations.DeleteGithubApp.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.InternalServerError.Body) { + public init(body: Operations.DeleteGithubApp.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CompleteGithubApp.Output.InternalServerError) + case internalServerError(Operations.DeleteGithubApp.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CompleteGithubApp.Output.InternalServerError { + public var internalServerError: Operations.DeleteGithubApp.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -46623,9 +51675,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/complete/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46641,26 +51693,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubApp.Output.ServiceUnavailable.Body + public var body: Operations.DeleteGithubApp.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubApp.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteGithubApp.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/complete/post(completeGithubApp)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CompleteGithubApp.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteGithubApp.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CompleteGithubApp.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteGithubApp.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -46710,127 +51762,96 @@ public enum Operations { } } } - /// Starts creating a private GitHub App. The client posts `manifest` as a form field to `url`; GitHub then sends the owner to `{origin}/github-app/callback` with a code and state. + /// Replaces the bots that act through the App. A bot uses at most one App per GitHub account; 409 when a bot already uses another App for this App's account. /// - /// - Remark: HTTP `POST /v1/github-apps/manifest`. - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)`. - public enum CreateGithubAppManifest { - public static let id: Swift.String = "createGithubAppManifest" + /// - Remark: HTTP `PUT /v1/github-apps/{id}/bots`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)`. + public enum SetGithubAppBots { + public static let id: Swift.String = "setGithubAppBots" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.SetGithubAppBots.Input.Path + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CreateGithubAppManifest.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody`. + public var headers: Operations.SetGithubAppBots.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json/name`. - public var name: Swift.String - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json/organization`. - public var organization: Swift.String? - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/json/origin`. - public var origin: Swift.String + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody/json/botIds`. + public var botIds: [Swift.String] /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - name: - /// - organization: - /// - origin: - public init( - name: Swift.String, - organization: Swift.String? = nil, - origin: Swift.String - ) { - self.name = name - self.organization = organization - self.origin = origin + /// - botIds: + public init(botIds: [Swift.String]) { + self.botIds = botIds } public enum CodingKeys: String, CodingKey { - case name - case organization - case origin + case botIds } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.name = try container.decode( - Swift.String.self, - forKey: .name - ) - self.organization = try container.decodeIfPresent( - Swift.String.self, - forKey: .organization - ) - self.origin = try container.decode( - Swift.String.self, - forKey: .origin + self.botIds = try container.decode( + [Swift.String].self, + forKey: .botIds ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "name", - "organization", - "origin" + "botIds" ]) } } - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/requestBody/content/application\/json`. - case json(Operations.CreateGithubAppManifest.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody/content/application\/json`. + case json(Operations.SetGithubAppBots.Input.Body.JsonPayload) } - public var body: Operations.CreateGithubAppManifest.Input.Body + public var body: Operations.SetGithubAppBots.Input.Body /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: /// - body: public init( - headers: Operations.CreateGithubAppManifest.Input.Headers = .init(), - body: Operations.CreateGithubAppManifest.Input.Body + path: Operations.SetGithubAppBots.Input.Path, + headers: Operations.SetGithubAppBots.Input.Headers = .init(), + body: Operations.SetGithubAppBots.Input.Body ) { + self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/json/manifest`. - public var manifest: Swift.String - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/json/url`. - public var url: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - manifest: - /// - url: - public init( - manifest: Swift.String, - url: Swift.String - ) { - self.manifest = manifest - self.url = url - } - public enum CodingKeys: String, CodingKey { - case manifest - case url - } - } - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/200/content/application\/json`. - case json(Operations.CreateGithubAppManifest.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/200/content/application\/json`. + case json(Components.Schemas.GitHubApp) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.CreateGithubAppManifest.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.GitHubApp { get throws { switch self { case let .json(body): @@ -46840,26 +51861,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.Ok.Body + public var body: Operations.SetGithubAppBots.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.Ok.Body) { + public init(body: Operations.SetGithubAppBots.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CreateGithubAppManifest.Output.Ok) + case ok(Operations.SetGithubAppBots.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.CreateGithubAppManifest.Output.Ok { + public var ok: Operations.SetGithubAppBots.Output.Ok { get throws { switch self { case let .ok(response): @@ -46873,9 +51894,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46891,26 +51912,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.BadRequest.Body + public var body: Operations.SetGithubAppBots.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.BadRequest.Body) { + public init(body: Operations.SetGithubAppBots.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CreateGithubAppManifest.Output.BadRequest) + case badRequest(Operations.SetGithubAppBots.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CreateGithubAppManifest.Output.BadRequest { + public var badRequest: Operations.SetGithubAppBots.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -46924,9 +51945,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -46942,26 +51963,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.Unauthorized.Body + public var body: Operations.SetGithubAppBots.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.Unauthorized.Body) { + public init(body: Operations.SetGithubAppBots.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CreateGithubAppManifest.Output.Unauthorized) + case unauthorized(Operations.SetGithubAppBots.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CreateGithubAppManifest.Output.Unauthorized { + public var unauthorized: Operations.SetGithubAppBots.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -46975,9 +51996,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -46993,26 +52014,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.NotFound.Body + public var body: Operations.SetGithubAppBots.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.NotFound.Body) { + public init(body: Operations.SetGithubAppBots.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CreateGithubAppManifest.Output.NotFound) + case notFound(Operations.SetGithubAppBots.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CreateGithubAppManifest.Output.NotFound { + public var notFound: Operations.SetGithubAppBots.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -47026,9 +52047,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47044,26 +52065,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.MethodNotAllowed.Body + public var body: Operations.SetGithubAppBots.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.MethodNotAllowed.Body) { + public init(body: Operations.SetGithubAppBots.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CreateGithubAppManifest.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SetGithubAppBots.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CreateGithubAppManifest.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SetGithubAppBots.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -47077,9 +52098,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47095,26 +52116,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.Conflict.Body + public var body: Operations.SetGithubAppBots.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.Conflict.Body) { + public init(body: Operations.SetGithubAppBots.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CreateGithubAppManifest.Output.Conflict) + case conflict(Operations.SetGithubAppBots.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CreateGithubAppManifest.Output.Conflict { + public var conflict: Operations.SetGithubAppBots.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -47128,9 +52149,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -47146,26 +52167,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.ContentTooLarge.Body + public var body: Operations.SetGithubAppBots.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.ContentTooLarge.Body) { + public init(body: Operations.SetGithubAppBots.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CreateGithubAppManifest.Output.ContentTooLarge) + case contentTooLarge(Operations.SetGithubAppBots.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CreateGithubAppManifest.Output.ContentTooLarge { + public var contentTooLarge: Operations.SetGithubAppBots.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -47179,9 +52200,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47197,26 +52218,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.InternalServerError.Body + public var body: Operations.SetGithubAppBots.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.InternalServerError.Body) { + public init(body: Operations.SetGithubAppBots.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CreateGithubAppManifest.Output.InternalServerError) + case internalServerError(Operations.SetGithubAppBots.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CreateGithubAppManifest.Output.InternalServerError { + public var internalServerError: Operations.SetGithubAppBots.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -47230,9 +52251,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/manifest/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47248,26 +52269,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGithubAppManifest.Output.ServiceUnavailable.Body + public var body: Operations.SetGithubAppBots.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGithubAppManifest.Output.ServiceUnavailable.Body) { + public init(body: Operations.SetGithubAppBots.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/manifest/post(createGithubAppManifest)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CreateGithubAppManifest.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SetGithubAppBots.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CreateGithubAppManifest.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SetGithubAppBots.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -47317,87 +52338,131 @@ public enum Operations { } } } - /// Exchanges the code GitHub sent the owner back with for the owner's tokens, within ten minutes of starting. 400 for a stale or reused state or a refused sign-in. + /// Stores a client secret generated in the App's GitHub settings, for an App created before Crumble kept it. /// - /// - Remark: HTTP `POST /v1/github-apps/sign-in/complete`. - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)`. - public enum CompleteGithubAppSignIn { - public static let id: Swift.String = "completeGithubAppSignIn" + /// - Remark: HTTP `PUT /v1/github-apps/{id}/client-secret`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)`. + public enum SetGithubAppClientSecret { + public static let id: Swift.String = "setGithubAppClientSecret" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/header`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.SetGithubAppClientSecret.Input.Path + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CompleteGithubAppSignIn.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody`. + public var headers: Operations.SetGithubAppClientSecret.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/json/code`. - public var code: Swift.String - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/json/state`. - public var state: Swift.String + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference`. + public struct ReferencePayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference/passwordManager`. + @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { + case _1password = "1password" + case bitwarden = "bitwarden" + } + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference/passwordManager`. + public var passwordManager: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference/reference`. + public var reference: Swift.String + /// Creates a new `ReferencePayload`. + /// + /// - Parameters: + /// - passwordManager: + /// - reference: + public init( + passwordManager: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload, + reference: Swift.String + ) { + self.passwordManager = passwordManager + self.reference = reference + } + public enum CodingKeys: String, CodingKey { + case passwordManager + case reference + } + } + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference`. + public var reference: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload? + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/value`. + public var value: Swift.String? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - code: - /// - state: + /// - reference: + /// - value: public init( - code: Swift.String, - state: Swift.String + reference: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload? = nil, + value: Swift.String? = nil ) { - self.code = code - self.state = state + self.reference = reference + self.value = value } public enum CodingKeys: String, CodingKey { - case code - case state + case reference + case value } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.code = try container.decode( - Swift.String.self, - forKey: .code + self.reference = try container.decodeIfPresent( + Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload.self, + forKey: .reference ) - self.state = try container.decode( + self.value = try container.decodeIfPresent( Swift.String.self, - forKey: .state + forKey: .value ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "code", - "state" + "reference", + "value" ]) } } - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/requestBody/content/application\/json`. - case json(Operations.CompleteGithubAppSignIn.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/content/application\/json`. + case json(Operations.SetGithubAppClientSecret.Input.Body.JsonPayload) } - public var body: Operations.CompleteGithubAppSignIn.Input.Body + public var body: Operations.SetGithubAppClientSecret.Input.Body /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: /// - body: public init( - headers: Operations.CompleteGithubAppSignIn.Input.Headers = .init(), - body: Operations.CompleteGithubAppSignIn.Input.Body + path: Operations.SetGithubAppClientSecret.Input.Path, + headers: Operations.SetGithubAppClientSecret.Input.Headers = .init(), + body: Operations.SetGithubAppClientSecret.Input.Body ) { + self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/200/content/application\/json`. case json(Components.Schemas.GitHubApp) /// The associated value of the enum case if `self` is `.json`. /// @@ -47413,26 +52478,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.Ok.Body + public var body: Operations.SetGithubAppClientSecret.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.Ok.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.CompleteGithubAppSignIn.Output.Ok) + case ok(Operations.SetGithubAppClientSecret.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.CompleteGithubAppSignIn.Output.Ok { + public var ok: Operations.SetGithubAppClientSecret.Output.Ok { get throws { switch self { case let .ok(response): @@ -47446,9 +52511,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47464,26 +52529,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.BadRequest.Body + public var body: Operations.SetGithubAppClientSecret.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.BadRequest.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CompleteGithubAppSignIn.Output.BadRequest) + case badRequest(Operations.SetGithubAppClientSecret.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CompleteGithubAppSignIn.Output.BadRequest { + public var badRequest: Operations.SetGithubAppClientSecret.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -47497,9 +52562,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -47515,26 +52580,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.Unauthorized.Body + public var body: Operations.SetGithubAppClientSecret.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.Unauthorized.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CompleteGithubAppSignIn.Output.Unauthorized) + case unauthorized(Operations.SetGithubAppClientSecret.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CompleteGithubAppSignIn.Output.Unauthorized { + public var unauthorized: Operations.SetGithubAppClientSecret.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -47548,9 +52613,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47566,26 +52631,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.NotFound.Body + public var body: Operations.SetGithubAppClientSecret.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.NotFound.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CompleteGithubAppSignIn.Output.NotFound) + case notFound(Operations.SetGithubAppClientSecret.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CompleteGithubAppSignIn.Output.NotFound { + public var notFound: Operations.SetGithubAppClientSecret.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -47599,9 +52664,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47617,26 +52682,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed.Body + public var body: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SetGithubAppClientSecret.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CompleteGithubAppSignIn.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -47650,9 +52715,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47668,26 +52733,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.Conflict.Body + public var body: Operations.SetGithubAppClientSecret.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.Conflict.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CompleteGithubAppSignIn.Output.Conflict) + case conflict(Operations.SetGithubAppClientSecret.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CompleteGithubAppSignIn.Output.Conflict { + public var conflict: Operations.SetGithubAppClientSecret.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -47701,9 +52766,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -47719,26 +52784,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge.Body + public var body: Operations.SetGithubAppClientSecret.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CompleteGithubAppSignIn.Output.ContentTooLarge) + case contentTooLarge(Operations.SetGithubAppClientSecret.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CompleteGithubAppSignIn.Output.ContentTooLarge { + public var contentTooLarge: Operations.SetGithubAppClientSecret.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -47752,9 +52817,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47770,26 +52835,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.InternalServerError.Body + public var body: Operations.SetGithubAppClientSecret.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.InternalServerError.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CompleteGithubAppSignIn.Output.InternalServerError) + case internalServerError(Operations.SetGithubAppClientSecret.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CompleteGithubAppSignIn.Output.InternalServerError { + public var internalServerError: Operations.SetGithubAppClientSecret.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -47803,9 +52868,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/sign-in/complete/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47821,26 +52886,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable.Body + public var body: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable.Body) { + public init(body: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/sign-in/complete/post(completeGithubAppSignIn)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SetGithubAppClientSecret.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CompleteGithubAppSignIn.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -47890,16 +52955,16 @@ public enum Operations { } } } - /// Forgets the App, signs the owner out of it, and takes GH_TOKEN from bots left without an installed App. The App stays on GitHub until the owner deletes it there. + /// Finds the App's installation on its account and gives its bots the GH_TOKEN credential. 409 until the owner installs the App. /// - /// - Remark: HTTP `DELETE /v1/github-apps/{id}`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)`. - public enum DeleteGithubApp { - public static let id: Swift.String = "deleteGithubApp" + /// - Remark: HTTP `POST /v1/github-apps/{id}/connect`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)`. + public enum ConnectGithubApp { + public static let id: Swift.String = "connectGithubApp" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/path`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/path/id`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -47909,72 +52974,88 @@ public enum Operations { self.id = id } } - public var path: Operations.DeleteGithubApp.Input.Path - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/header`. + public var path: Operations.ConnectGithubApp.Input.Path + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeleteGithubApp.Input.Headers + public var headers: Operations.ConnectGithubApp.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.DeleteGithubApp.Input.Path, - headers: Operations.DeleteGithubApp.Input.Headers = .init() + path: Operations.ConnectGithubApp.Input.Path, + headers: Operations.ConnectGithubApp.Input.Headers = .init() ) { self.path = path self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/200/content/application\/json`. + case json(Components.Schemas.GitHubApp) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.GitHubApp { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ConnectGithubApp.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ConnectGithubApp.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteGithubApp.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/204`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ConnectGithubApp.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteGithubApp.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ConnectGithubApp.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -47990,26 +53071,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.BadRequest.Body + public var body: Operations.ConnectGithubApp.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.BadRequest.Body) { + public init(body: Operations.ConnectGithubApp.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteGithubApp.Output.BadRequest) + case badRequest(Operations.ConnectGithubApp.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteGithubApp.Output.BadRequest { + public var badRequest: Operations.ConnectGithubApp.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -48023,9 +53104,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -48041,26 +53122,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.Unauthorized.Body + public var body: Operations.ConnectGithubApp.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.Unauthorized.Body) { + public init(body: Operations.ConnectGithubApp.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteGithubApp.Output.Unauthorized) + case unauthorized(Operations.ConnectGithubApp.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteGithubApp.Output.Unauthorized { + public var unauthorized: Operations.ConnectGithubApp.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -48074,9 +53155,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48092,26 +53173,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.NotFound.Body + public var body: Operations.ConnectGithubApp.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.NotFound.Body) { + public init(body: Operations.ConnectGithubApp.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteGithubApp.Output.NotFound) + case notFound(Operations.ConnectGithubApp.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteGithubApp.Output.NotFound { + public var notFound: Operations.ConnectGithubApp.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -48125,9 +53206,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48143,26 +53224,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.MethodNotAllowed.Body + public var body: Operations.ConnectGithubApp.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.MethodNotAllowed.Body) { + public init(body: Operations.ConnectGithubApp.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteGithubApp.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ConnectGithubApp.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteGithubApp.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ConnectGithubApp.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -48176,9 +53257,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48194,26 +53275,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.Conflict.Body + public var body: Operations.ConnectGithubApp.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.Conflict.Body) { + public init(body: Operations.ConnectGithubApp.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteGithubApp.Output.Conflict) + case conflict(Operations.ConnectGithubApp.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteGithubApp.Output.Conflict { + public var conflict: Operations.ConnectGithubApp.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -48227,9 +53308,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -48245,26 +53326,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.ContentTooLarge.Body + public var body: Operations.ConnectGithubApp.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.ContentTooLarge.Body) { + public init(body: Operations.ConnectGithubApp.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteGithubApp.Output.ContentTooLarge) + case contentTooLarge(Operations.ConnectGithubApp.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteGithubApp.Output.ContentTooLarge { + public var contentTooLarge: Operations.ConnectGithubApp.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -48278,9 +53359,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48296,26 +53377,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.InternalServerError.Body + public var body: Operations.ConnectGithubApp.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.InternalServerError.Body) { + public init(body: Operations.ConnectGithubApp.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteGithubApp.Output.InternalServerError) + case internalServerError(Operations.ConnectGithubApp.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteGithubApp.Output.InternalServerError { + public var internalServerError: Operations.ConnectGithubApp.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -48329,9 +53410,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48347,26 +53428,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGithubApp.Output.ServiceUnavailable.Body + public var body: Operations.ConnectGithubApp.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGithubApp.Output.ServiceUnavailable.Body) { + public init(body: Operations.ConnectGithubApp.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/delete(deleteGithubApp)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteGithubApp.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ConnectGithubApp.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteGithubApp.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ConnectGithubApp.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -48416,16 +53497,16 @@ public enum Operations { } } } - /// Replaces the bots that act through the App. A bot uses at most one App per GitHub account; 409 when a bot already uses another App for this App's account. + /// Starts signing the owner in to GitHub through the App, so its bots act as the owner. The client opens `url`; GitHub sends the owner to the App's callback URL, `{origin}/github-app/authorized`, or `{origin}/ui/github-app/authorized` for Apps created before the web UI moved to `/`, with a code and state. `origin` is no longer used. 409 without a client secret. /// - /// - Remark: HTTP `PUT /v1/github-apps/{id}/bots`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)`. - public enum SetGithubAppBots { - public static let id: Swift.String = "setGithubAppBots" + /// - Remark: HTTP `POST /v1/github-apps/{id}/sign-in`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)`. + public enum SignInGithubApp { + public static let id: Swift.String = "signInGithubApp" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/path`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/path/id`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -48435,50 +53516,50 @@ public enum Operations { self.id = id } } - public var path: Operations.SetGithubAppBots.Input.Path - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/header`. + public var path: Operations.SignInGithubApp.Input.Path + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SetGithubAppBots.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody`. + public var headers: Operations.SignInGithubApp.Input.Headers + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody/json/botIds`. - public var botIds: [Swift.String] + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody/json/origin`. + public var origin: Swift.String /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - botIds: - public init(botIds: [Swift.String]) { - self.botIds = botIds + /// - origin: + public init(origin: Swift.String) { + self.origin = origin } public enum CodingKeys: String, CodingKey { - case botIds + case origin } public init(from decoder: any Swift.Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) - self.botIds = try container.decode( - [Swift.String].self, - forKey: .botIds + self.origin = try container.decode( + Swift.String.self, + forKey: .origin ) try decoder.ensureNoAdditionalProperties(knownKeys: [ - "botIds" + "origin" ]) } } - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/requestBody/content/application\/json`. - case json(Operations.SetGithubAppBots.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody/content/application\/json`. + case json(Operations.SignInGithubApp.Input.Body.JsonPayload) } - public var body: Operations.SetGithubAppBots.Input.Body + public var body: Operations.SignInGithubApp.Input.Body /// Creates a new `Input`. /// /// - Parameters: @@ -48486,9 +53567,9 @@ public enum Operations { /// - headers: /// - body: public init( - path: Operations.SetGithubAppBots.Input.Path, - headers: Operations.SetGithubAppBots.Input.Headers = .init(), - body: Operations.SetGithubAppBots.Input.Body + path: Operations.SignInGithubApp.Input.Path, + headers: Operations.SignInGithubApp.Input.Headers = .init(), + body: Operations.SignInGithubApp.Input.Body ) { self.path = path self.headers = headers @@ -48497,15 +53578,30 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/200/content/application\/json`. - case json(Components.Schemas.GitHubApp) + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content/json/url`. + public var url: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - url: + public init(url: Swift.String) { + self.url = url + } + public enum CodingKeys: String, CodingKey { + case url + } + } + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content/application\/json`. + case json(Operations.SignInGithubApp.Output.Ok.Body.JsonPayload) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.GitHubApp { + public var json: Operations.SignInGithubApp.Output.Ok.Body.JsonPayload { get throws { switch self { case let .json(body): @@ -48515,26 +53611,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.Ok.Body + public var body: Operations.SignInGithubApp.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.Ok.Body) { + public init(body: Operations.SignInGithubApp.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SetGithubAppBots.Output.Ok) + case ok(Operations.SignInGithubApp.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SetGithubAppBots.Output.Ok { + public var ok: Operations.SignInGithubApp.Output.Ok { get throws { switch self { case let .ok(response): @@ -48548,9 +53644,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48566,26 +53662,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.BadRequest.Body + public var body: Operations.SignInGithubApp.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.BadRequest.Body) { + public init(body: Operations.SignInGithubApp.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SetGithubAppBots.Output.BadRequest) + case badRequest(Operations.SignInGithubApp.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SetGithubAppBots.Output.BadRequest { + public var badRequest: Operations.SignInGithubApp.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -48599,9 +53695,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -48617,26 +53713,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.Unauthorized.Body + public var body: Operations.SignInGithubApp.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.Unauthorized.Body) { + public init(body: Operations.SignInGithubApp.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SetGithubAppBots.Output.Unauthorized) + case unauthorized(Operations.SignInGithubApp.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SetGithubAppBots.Output.Unauthorized { + public var unauthorized: Operations.SignInGithubApp.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -48650,9 +53746,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48668,26 +53764,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.NotFound.Body + public var body: Operations.SignInGithubApp.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.NotFound.Body) { + public init(body: Operations.SignInGithubApp.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SetGithubAppBots.Output.NotFound) + case notFound(Operations.SignInGithubApp.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SetGithubAppBots.Output.NotFound { + public var notFound: Operations.SignInGithubApp.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -48701,9 +53797,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48719,26 +53815,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.MethodNotAllowed.Body + public var body: Operations.SignInGithubApp.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.MethodNotAllowed.Body) { + public init(body: Operations.SignInGithubApp.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SetGithubAppBots.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SignInGithubApp.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SetGithubAppBots.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SignInGithubApp.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -48752,9 +53848,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48770,26 +53866,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.Conflict.Body + public var body: Operations.SignInGithubApp.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.Conflict.Body) { + public init(body: Operations.SignInGithubApp.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SetGithubAppBots.Output.Conflict) + case conflict(Operations.SignInGithubApp.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SetGithubAppBots.Output.Conflict { + public var conflict: Operations.SignInGithubApp.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -48803,9 +53899,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -48821,26 +53917,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.ContentTooLarge.Body + public var body: Operations.SignInGithubApp.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.ContentTooLarge.Body) { + public init(body: Operations.SignInGithubApp.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SetGithubAppBots.Output.ContentTooLarge) + case contentTooLarge(Operations.SignInGithubApp.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SetGithubAppBots.Output.ContentTooLarge { + public var contentTooLarge: Operations.SignInGithubApp.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -48854,9 +53950,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48872,26 +53968,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.InternalServerError.Body + public var body: Operations.SignInGithubApp.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.InternalServerError.Body) { + public init(body: Operations.SignInGithubApp.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SetGithubAppBots.Output.InternalServerError) + case internalServerError(Operations.SignInGithubApp.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SetGithubAppBots.Output.InternalServerError { + public var internalServerError: Operations.SignInGithubApp.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -48905,9 +54001,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/bots/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -48923,26 +54019,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppBots.Output.ServiceUnavailable.Body + public var body: Operations.SignInGithubApp.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppBots.Output.ServiceUnavailable.Body) { + public init(body: Operations.SignInGithubApp.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/bots/put(setGithubAppBots)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SetGithubAppBots.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SignInGithubApp.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SetGithubAppBots.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SignInGithubApp.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -48992,16 +54088,16 @@ public enum Operations { } } } - /// Stores a client secret generated in the App's GitHub settings, for an App created before Crumble kept it. + /// Revokes and forgets the owner's sign-in through the App; its bots act as the App again. /// - /// - Remark: HTTP `PUT /v1/github-apps/{id}/client-secret`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)`. - public enum SetGithubAppClientSecret { - public static let id: Swift.String = "setGithubAppClientSecret" + /// - Remark: HTTP `DELETE /v1/github-apps/{id}/user`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)`. + public enum SignOutGithubApp { + public static let id: Swift.String = "signOutGithubApp" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/path`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/path/id`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -49011,112 +54107,37 @@ public enum Operations { self.id = id } } - public var path: Operations.SetGithubAppClientSecret.Input.Path - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/header`. + public var path: Operations.SignOutGithubApp.Input.Path + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SetGithubAppClientSecret.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference`. - public struct ReferencePayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference/passwordManager`. - @frozen public enum PasswordManagerPayload: String, Codable, Hashable, Sendable, CaseIterable { - case _1password = "1password" - case bitwarden = "bitwarden" - } - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference/passwordManager`. - public var passwordManager: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference/reference`. - public var reference: Swift.String - /// Creates a new `ReferencePayload`. - /// - /// - Parameters: - /// - passwordManager: - /// - reference: - public init( - passwordManager: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload.PasswordManagerPayload, - reference: Swift.String - ) { - self.passwordManager = passwordManager - self.reference = reference - } - public enum CodingKeys: String, CodingKey { - case passwordManager - case reference - } - } - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/reference`. - public var reference: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload? - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/json/value`. - public var value: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - reference: - /// - value: - public init( - reference: Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload? = nil, - value: Swift.String? = nil - ) { - self.reference = reference - self.value = value - } - public enum CodingKeys: String, CodingKey { - case reference - case value - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.reference = try container.decodeIfPresent( - Operations.SetGithubAppClientSecret.Input.Body.JsonPayload.ReferencePayload.self, - forKey: .reference - ) - self.value = try container.decodeIfPresent( - Swift.String.self, - forKey: .value - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "reference", - "value" - ]) - } - } - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/requestBody/content/application\/json`. - case json(Operations.SetGithubAppClientSecret.Input.Body.JsonPayload) - } - public var body: Operations.SetGithubAppClientSecret.Input.Body + public var headers: Operations.SignOutGithubApp.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: - /// - body: public init( - path: Operations.SetGithubAppClientSecret.Input.Path, - headers: Operations.SetGithubAppClientSecret.Input.Headers = .init(), - body: Operations.SetGithubAppClientSecret.Input.Body + path: Operations.SignOutGithubApp.Input.Path, + headers: Operations.SignOutGithubApp.Input.Headers = .init() ) { self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/200/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/200/content/application\/json`. case json(Components.Schemas.GitHubApp) /// The associated value of the enum case if `self` is `.json`. /// @@ -49132,26 +54153,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.Ok.Body + public var body: Operations.SignOutGithubApp.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.Ok.Body) { + public init(body: Operations.SignOutGithubApp.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/200`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SetGithubAppClientSecret.Output.Ok) + case ok(Operations.SignOutGithubApp.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SetGithubAppClientSecret.Output.Ok { + public var ok: Operations.SignOutGithubApp.Output.Ok { get throws { switch self { case let .ok(response): @@ -49165,9 +54186,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49183,26 +54204,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.BadRequest.Body + public var body: Operations.SignOutGithubApp.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.BadRequest.Body) { + public init(body: Operations.SignOutGithubApp.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/400`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SetGithubAppClientSecret.Output.BadRequest) + case badRequest(Operations.SignOutGithubApp.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SetGithubAppClientSecret.Output.BadRequest { + public var badRequest: Operations.SignOutGithubApp.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -49216,9 +54237,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -49234,26 +54255,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.Unauthorized.Body + public var body: Operations.SignOutGithubApp.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.Unauthorized.Body) { + public init(body: Operations.SignOutGithubApp.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/401`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SetGithubAppClientSecret.Output.Unauthorized) + case unauthorized(Operations.SignOutGithubApp.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SetGithubAppClientSecret.Output.Unauthorized { + public var unauthorized: Operations.SignOutGithubApp.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -49267,9 +54288,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49285,26 +54306,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.NotFound.Body + public var body: Operations.SignOutGithubApp.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.NotFound.Body) { + public init(body: Operations.SignOutGithubApp.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/404`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SetGithubAppClientSecret.Output.NotFound) + case notFound(Operations.SignOutGithubApp.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SetGithubAppClientSecret.Output.NotFound { + public var notFound: Operations.SignOutGithubApp.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -49318,9 +54339,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49336,26 +54357,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed.Body + public var body: Operations.SignOutGithubApp.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed.Body) { + public init(body: Operations.SignOutGithubApp.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/405`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SetGithubAppClientSecret.Output.MethodNotAllowed) + case methodNotAllowed(Operations.SignOutGithubApp.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SetGithubAppClientSecret.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.SignOutGithubApp.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -49369,9 +54390,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49387,26 +54408,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.Conflict.Body + public var body: Operations.SignOutGithubApp.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.Conflict.Body) { + public init(body: Operations.SignOutGithubApp.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/409`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SetGithubAppClientSecret.Output.Conflict) + case conflict(Operations.SignOutGithubApp.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SetGithubAppClientSecret.Output.Conflict { + public var conflict: Operations.SignOutGithubApp.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -49420,9 +54441,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -49438,26 +54459,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.ContentTooLarge.Body + public var body: Operations.SignOutGithubApp.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.ContentTooLarge.Body) { + public init(body: Operations.SignOutGithubApp.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/413`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SetGithubAppClientSecret.Output.ContentTooLarge) + case contentTooLarge(Operations.SignOutGithubApp.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SetGithubAppClientSecret.Output.ContentTooLarge { + public var contentTooLarge: Operations.SignOutGithubApp.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -49471,9 +54492,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49489,26 +54510,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.InternalServerError.Body + public var body: Operations.SignOutGithubApp.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.InternalServerError.Body) { + public init(body: Operations.SignOutGithubApp.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/500`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SetGithubAppClientSecret.Output.InternalServerError) + case internalServerError(Operations.SignOutGithubApp.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SetGithubAppClientSecret.Output.InternalServerError { + public var internalServerError: Operations.SignOutGithubApp.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -49522,9 +54543,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/client-secret/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49540,26 +54561,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable.Body + public var body: Operations.SignOutGithubApp.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable.Body) { + public init(body: Operations.SignOutGithubApp.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/client-secret/put(setGithubAppClientSecret)/responses/503`. + /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SetGithubAppClientSecret.Output.ServiceUnavailable) + case serviceUnavailable(Operations.SignOutGithubApp.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SetGithubAppClientSecret.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.SignOutGithubApp.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -49609,62 +54630,42 @@ public enum Operations { } } } - /// Finds the App's installation on its account and gives its bots the GH_TOKEN credential. 409 until the owner installs the App. - /// - /// - Remark: HTTP `POST /v1/github-apps/{id}/connect`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)`. - public enum ConnectGithubApp { - public static let id: Swift.String = "connectGithubApp" + /// - Remark: HTTP `GET /v1/group-chats`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)`. + public enum ListGroupChats { + public static let id: Swift.String = "listGroupChats" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.ConnectGithubApp.Input.Path - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/header`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ConnectGithubApp.Input.Headers + public var headers: Operations.ListGroupChats.Input.Headers /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: - public init( - path: Operations.ConnectGithubApp.Input.Path, - headers: Operations.ConnectGithubApp.Input.Headers = .init() - ) { - self.path = path + public init(headers: Operations.ListGroupChats.Input.Headers = .init()) { self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/200/content/application\/json`. - case json(Components.Schemas.GitHubApp) + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/200/content/application\/json`. + case json([Components.Schemas.GroupChat]) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.GitHubApp { + public var json: [Components.Schemas.GroupChat] { get throws { switch self { case let .json(body): @@ -49674,26 +54675,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.Ok.Body + public var body: Operations.ListGroupChats.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.Ok.Body) { + public init(body: Operations.ListGroupChats.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ConnectGithubApp.Output.Ok) + case ok(Operations.ListGroupChats.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ConnectGithubApp.Output.Ok { + public var ok: Operations.ListGroupChats.Output.Ok { get throws { switch self { case let .ok(response): @@ -49707,9 +54708,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49725,26 +54726,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.BadRequest.Body + public var body: Operations.ListGroupChats.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.BadRequest.Body) { + public init(body: Operations.ListGroupChats.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ConnectGithubApp.Output.BadRequest) + case badRequest(Operations.ListGroupChats.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ConnectGithubApp.Output.BadRequest { + public var badRequest: Operations.ListGroupChats.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -49758,9 +54759,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -49776,26 +54777,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.Unauthorized.Body + public var body: Operations.ListGroupChats.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.Unauthorized.Body) { + public init(body: Operations.ListGroupChats.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ConnectGithubApp.Output.Unauthorized) + case unauthorized(Operations.ListGroupChats.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ConnectGithubApp.Output.Unauthorized { + public var unauthorized: Operations.ListGroupChats.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -49809,9 +54810,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49827,26 +54828,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.NotFound.Body + public var body: Operations.ListGroupChats.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.NotFound.Body) { + public init(body: Operations.ListGroupChats.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ConnectGithubApp.Output.NotFound) + case notFound(Operations.ListGroupChats.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ConnectGithubApp.Output.NotFound { + public var notFound: Operations.ListGroupChats.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -49860,9 +54861,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49878,26 +54879,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.MethodNotAllowed.Body + public var body: Operations.ListGroupChats.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListGroupChats.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ConnectGithubApp.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListGroupChats.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ConnectGithubApp.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListGroupChats.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -49911,9 +54912,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -49929,26 +54930,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.Conflict.Body + public var body: Operations.ListGroupChats.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.Conflict.Body) { + public init(body: Operations.ListGroupChats.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ConnectGithubApp.Output.Conflict) + case conflict(Operations.ListGroupChats.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ConnectGithubApp.Output.Conflict { + public var conflict: Operations.ListGroupChats.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -49962,9 +54963,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -49980,26 +54981,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.ContentTooLarge.Body + public var body: Operations.ListGroupChats.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.ContentTooLarge.Body) { + public init(body: Operations.ListGroupChats.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ConnectGithubApp.Output.ContentTooLarge) + case contentTooLarge(Operations.ListGroupChats.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ConnectGithubApp.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListGroupChats.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -50013,9 +55014,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50031,26 +55032,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.InternalServerError.Body + public var body: Operations.ListGroupChats.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.InternalServerError.Body) { + public init(body: Operations.ListGroupChats.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ConnectGithubApp.Output.InternalServerError) + case internalServerError(Operations.ListGroupChats.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ConnectGithubApp.Output.InternalServerError { + public var internalServerError: Operations.ListGroupChats.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -50064,9 +55065,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/connect/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50082,26 +55083,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ConnectGithubApp.Output.ServiceUnavailable.Body + public var body: Operations.ListGroupChats.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ConnectGithubApp.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListGroupChats.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/connect/post(connectGithubApp)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ConnectGithubApp.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListGroupChats.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ConnectGithubApp.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListGroupChats.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -50151,111 +55152,76 @@ public enum Operations { } } } - /// Starts signing the owner in to GitHub through the App, so its bots act as the owner. The client opens `url`; GitHub sends the owner to the App's callback URL, `{origin}/github-app/authorized`, or `{origin}/ui/github-app/authorized` for Apps created before the web UI moved to `/`, with a code and state. `origin` is no longer used. 409 without a client secret. - /// - /// - Remark: HTTP `POST /v1/github-apps/{id}/sign-in`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)`. - public enum SignInGithubApp { - public static let id: Swift.String = "signInGithubApp" + /// - Remark: HTTP `POST /v1/group-chats`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)`. + public enum CreateGroupChat { + public static let id: Swift.String = "createGroupChat" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/path/id`. - public var id: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - id: - public init(id: Swift.String) { - self.id = id - } - } - public var path: Operations.SignInGithubApp.Input.Path - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/header`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SignInGithubApp.Input.Headers - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody`. + public var headers: Operations.CreateGroupChat.Input.Headers + /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody/json/origin`. - public var origin: Swift.String + /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/json/memberIds`. + public var memberIds: [Swift.String] + /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/json/name`. + public var name: Swift.String /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - origin: - public init(origin: Swift.String) { - self.origin = origin + /// - memberIds: + /// - name: + public init( + memberIds: [Swift.String], + name: Swift.String + ) { + self.memberIds = memberIds + self.name = name } public enum CodingKeys: String, CodingKey { - case origin - } - public init(from decoder: any Swift.Decoder) throws { - let container = try decoder.container(keyedBy: CodingKeys.self) - self.origin = try container.decode( - Swift.String.self, - forKey: .origin - ) - try decoder.ensureNoAdditionalProperties(knownKeys: [ - "origin" - ]) + case memberIds + case name } } - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/requestBody/content/application\/json`. - case json(Operations.SignInGithubApp.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/content/application\/json`. + case json(Operations.CreateGroupChat.Input.Body.JsonPayload) } - public var body: Operations.SignInGithubApp.Input.Body + public var body: Operations.CreateGroupChat.Input.Body /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: /// - body: public init( - path: Operations.SignInGithubApp.Input.Path, - headers: Operations.SignInGithubApp.Input.Headers = .init(), - body: Operations.SignInGithubApp.Input.Body + headers: Operations.CreateGroupChat.Input.Headers = .init(), + body: Operations.CreateGroupChat.Input.Body ) { - self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content/json/url`. - public var url: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - url: - public init(url: Swift.String) { - self.url = url - } - public enum CodingKeys: String, CodingKey { - case url - } - } - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/200/content/application\/json`. - case json(Operations.SignInGithubApp.Output.Ok.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/201/content/application\/json`. + case json(Components.Schemas.GroupChat) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Operations.SignInGithubApp.Output.Ok.Body.JsonPayload { + public var json: Components.Schemas.GroupChat { get throws { switch self { case let .json(body): @@ -50265,42 +55231,42 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.CreateGroupChat.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.Ok.Body) { + public init(body: Operations.CreateGroupChat.Output.Created.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.SignInGithubApp.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.CreateGroupChat.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.SignInGithubApp.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.CreateGroupChat.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50316,26 +55282,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.BadRequest.Body + public var body: Operations.CreateGroupChat.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.BadRequest.Body) { + public init(body: Operations.CreateGroupChat.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SignInGithubApp.Output.BadRequest) + case badRequest(Operations.CreateGroupChat.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SignInGithubApp.Output.BadRequest { + public var badRequest: Operations.CreateGroupChat.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -50349,9 +55315,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -50367,26 +55333,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.Unauthorized.Body + public var body: Operations.CreateGroupChat.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.Unauthorized.Body) { + public init(body: Operations.CreateGroupChat.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SignInGithubApp.Output.Unauthorized) + case unauthorized(Operations.CreateGroupChat.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SignInGithubApp.Output.Unauthorized { + public var unauthorized: Operations.CreateGroupChat.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -50400,9 +55366,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50418,26 +55384,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.NotFound.Body + public var body: Operations.CreateGroupChat.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.NotFound.Body) { + public init(body: Operations.CreateGroupChat.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SignInGithubApp.Output.NotFound) + case notFound(Operations.CreateGroupChat.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SignInGithubApp.Output.NotFound { + public var notFound: Operations.CreateGroupChat.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -50451,9 +55417,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50469,26 +55435,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.MethodNotAllowed.Body + public var body: Operations.CreateGroupChat.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.MethodNotAllowed.Body) { + public init(body: Operations.CreateGroupChat.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SignInGithubApp.Output.MethodNotAllowed) + case methodNotAllowed(Operations.CreateGroupChat.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SignInGithubApp.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.CreateGroupChat.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -50502,9 +55468,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50520,26 +55486,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.Conflict.Body + public var body: Operations.CreateGroupChat.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.Conflict.Body) { + public init(body: Operations.CreateGroupChat.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SignInGithubApp.Output.Conflict) + case conflict(Operations.CreateGroupChat.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SignInGithubApp.Output.Conflict { + public var conflict: Operations.CreateGroupChat.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -50553,9 +55519,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -50571,26 +55537,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.ContentTooLarge.Body + public var body: Operations.CreateGroupChat.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.ContentTooLarge.Body) { + public init(body: Operations.CreateGroupChat.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SignInGithubApp.Output.ContentTooLarge) + case contentTooLarge(Operations.CreateGroupChat.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SignInGithubApp.Output.ContentTooLarge { + public var contentTooLarge: Operations.CreateGroupChat.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -50604,9 +55570,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50622,26 +55588,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.InternalServerError.Body + public var body: Operations.CreateGroupChat.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.InternalServerError.Body) { + public init(body: Operations.CreateGroupChat.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SignInGithubApp.Output.InternalServerError) + case internalServerError(Operations.CreateGroupChat.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SignInGithubApp.Output.InternalServerError { + public var internalServerError: Operations.CreateGroupChat.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -50655,9 +55621,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/sign-in/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50673,26 +55639,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignInGithubApp.Output.ServiceUnavailable.Body + public var body: Operations.CreateGroupChat.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignInGithubApp.Output.ServiceUnavailable.Body) { + public init(body: Operations.CreateGroupChat.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/sign-in/post(signInGithubApp)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SignInGithubApp.Output.ServiceUnavailable) + case serviceUnavailable(Operations.CreateGroupChat.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SignInGithubApp.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.CreateGroupChat.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -50742,16 +55708,14 @@ public enum Operations { } } } - /// Revokes and forgets the owner's sign-in through the App; its bots act as the App again. - /// - /// - Remark: HTTP `DELETE /v1/github-apps/{id}/user`. - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)`. - public enum SignOutGithubApp { - public static let id: Swift.String = "signOutGithubApp" + /// - Remark: HTTP `GET /v1/group-chats/{id}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)`. + public enum GetGroupChat { + public static let id: Swift.String = "getGroupChat" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -50761,27 +55725,27 @@ public enum Operations { self.id = id } } - public var path: Operations.SignOutGithubApp.Input.Path - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/header`. + public var path: Operations.GetGroupChat.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.SignOutGithubApp.Input.Headers + public var headers: Operations.GetGroupChat.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: public init( - path: Operations.SignOutGithubApp.Input.Path, - headers: Operations.SignOutGithubApp.Input.Headers = .init() + path: Operations.GetGroupChat.Input.Path, + headers: Operations.GetGroupChat.Input.Headers = .init() ) { self.path = path self.headers = headers @@ -50789,15 +55753,15 @@ public enum Operations { } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/200/content/application\/json`. - case json(Components.Schemas.GitHubApp) + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/200/content/application\/json`. + case json(Components.Schemas.GroupChat) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.GitHubApp { + public var json: Components.Schemas.GroupChat { get throws { switch self { case let .json(body): @@ -50807,26 +55771,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.Ok.Body + public var body: Operations.GetGroupChat.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.Ok.Body) { + public init(body: Operations.GetGroupChat.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.SignOutGithubApp.Output.Ok) + case ok(Operations.GetGroupChat.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.SignOutGithubApp.Output.Ok { + public var ok: Operations.GetGroupChat.Output.Ok { get throws { switch self { case let .ok(response): @@ -50840,9 +55804,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50858,26 +55822,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.BadRequest.Body + public var body: Operations.GetGroupChat.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.BadRequest.Body) { + public init(body: Operations.GetGroupChat.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.SignOutGithubApp.Output.BadRequest) + case badRequest(Operations.GetGroupChat.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.SignOutGithubApp.Output.BadRequest { + public var badRequest: Operations.GetGroupChat.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -50891,9 +55855,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -50909,26 +55873,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.Unauthorized.Body + public var body: Operations.GetGroupChat.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.Unauthorized.Body) { + public init(body: Operations.GetGroupChat.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.SignOutGithubApp.Output.Unauthorized) + case unauthorized(Operations.GetGroupChat.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.SignOutGithubApp.Output.Unauthorized { + public var unauthorized: Operations.GetGroupChat.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -50942,9 +55906,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -50960,26 +55924,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.NotFound.Body + public var body: Operations.GetGroupChat.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.NotFound.Body) { + public init(body: Operations.GetGroupChat.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.SignOutGithubApp.Output.NotFound) + case notFound(Operations.GetGroupChat.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.SignOutGithubApp.Output.NotFound { + public var notFound: Operations.GetGroupChat.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -50993,9 +55957,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51011,26 +55975,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.MethodNotAllowed.Body + public var body: Operations.GetGroupChat.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.MethodNotAllowed.Body) { + public init(body: Operations.GetGroupChat.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.SignOutGithubApp.Output.MethodNotAllowed) + case methodNotAllowed(Operations.GetGroupChat.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.SignOutGithubApp.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.GetGroupChat.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -51044,9 +56008,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51062,26 +56026,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.Conflict.Body + public var body: Operations.GetGroupChat.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.Conflict.Body) { + public init(body: Operations.GetGroupChat.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.SignOutGithubApp.Output.Conflict) + case conflict(Operations.GetGroupChat.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.SignOutGithubApp.Output.Conflict { + public var conflict: Operations.GetGroupChat.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -51095,9 +56059,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -51113,26 +56077,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.ContentTooLarge.Body + public var body: Operations.GetGroupChat.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.ContentTooLarge.Body) { + public init(body: Operations.GetGroupChat.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.SignOutGithubApp.Output.ContentTooLarge) + case contentTooLarge(Operations.GetGroupChat.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.SignOutGithubApp.Output.ContentTooLarge { + public var contentTooLarge: Operations.GetGroupChat.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -51146,9 +56110,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51164,26 +56128,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.InternalServerError.Body + public var body: Operations.GetGroupChat.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.InternalServerError.Body) { + public init(body: Operations.GetGroupChat.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.SignOutGithubApp.Output.InternalServerError) + case internalServerError(Operations.GetGroupChat.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.SignOutGithubApp.Output.InternalServerError { + public var internalServerError: Operations.GetGroupChat.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -51197,9 +56161,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/github-apps/{id}/user/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51215,26 +56179,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.SignOutGithubApp.Output.ServiceUnavailable.Body + public var body: Operations.GetGroupChat.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.SignOutGithubApp.Output.ServiceUnavailable.Body) { + public init(body: Operations.GetGroupChat.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/github-apps/{id}/user/delete(signOutGithubApp)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.SignOutGithubApp.Output.ServiceUnavailable) + case serviceUnavailable(Operations.GetGroupChat.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.SignOutGithubApp.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.GetGroupChat.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -51284,42 +56248,92 @@ public enum Operations { } } } - /// - Remark: HTTP `GET /v1/group-chats`. - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)`. - public enum ListGroupChats { - public static let id: Swift.String = "listGroupChats" + /// - Remark: HTTP `PATCH /v1/group-chats/{id}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)`. + public enum UpdateGroupChat { + public static let id: Swift.String = "updateGroupChat" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/header`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.UpdateGroupChat.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.ListGroupChats.Input.Headers + public var headers: Operations.UpdateGroupChat.Input.Headers + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/json/memberIds`. + public var memberIds: [Swift.String]? + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/json/name`. + public var name: Swift.String? + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - memberIds: + /// - name: + public init( + memberIds: [Swift.String]? = nil, + name: Swift.String? = nil + ) { + self.memberIds = memberIds + self.name = name + } + public enum CodingKeys: String, CodingKey { + case memberIds + case name + } + } + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/content/application\/json`. + case json(Operations.UpdateGroupChat.Input.Body.JsonPayload) + } + public var body: Operations.UpdateGroupChat.Input.Body /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: - public init(headers: Operations.ListGroupChats.Input.Headers = .init()) { + /// - body: + public init( + path: Operations.UpdateGroupChat.Input.Path, + headers: Operations.UpdateGroupChat.Input.Headers = .init(), + body: Operations.UpdateGroupChat.Input.Body + ) { + self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/200/content/application\/json`. - case json([Components.Schemas.GroupChat]) + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/200/content/application\/json`. + case json(Components.Schemas.GroupChat) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: [Components.Schemas.GroupChat] { + public var json: Components.Schemas.GroupChat { get throws { switch self { case let .json(body): @@ -51329,26 +56343,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.Ok.Body + public var body: Operations.UpdateGroupChat.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.Ok.Body) { + public init(body: Operations.UpdateGroupChat.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.ListGroupChats.Output.Ok) + case ok(Operations.UpdateGroupChat.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.ListGroupChats.Output.Ok { + public var ok: Operations.UpdateGroupChat.Output.Ok { get throws { switch self { case let .ok(response): @@ -51362,9 +56376,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51380,26 +56394,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.BadRequest.Body + public var body: Operations.UpdateGroupChat.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.BadRequest.Body) { + public init(body: Operations.UpdateGroupChat.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.ListGroupChats.Output.BadRequest) + case badRequest(Operations.UpdateGroupChat.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.ListGroupChats.Output.BadRequest { + public var badRequest: Operations.UpdateGroupChat.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -51413,9 +56427,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -51431,26 +56445,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.Unauthorized.Body + public var body: Operations.UpdateGroupChat.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.Unauthorized.Body) { + public init(body: Operations.UpdateGroupChat.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.ListGroupChats.Output.Unauthorized) + case unauthorized(Operations.UpdateGroupChat.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.ListGroupChats.Output.Unauthorized { + public var unauthorized: Operations.UpdateGroupChat.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -51464,9 +56478,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51482,26 +56496,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.NotFound.Body + public var body: Operations.UpdateGroupChat.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.NotFound.Body) { + public init(body: Operations.UpdateGroupChat.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.ListGroupChats.Output.NotFound) + case notFound(Operations.UpdateGroupChat.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.ListGroupChats.Output.NotFound { + public var notFound: Operations.UpdateGroupChat.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -51515,9 +56529,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51533,26 +56547,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.MethodNotAllowed.Body + public var body: Operations.UpdateGroupChat.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.MethodNotAllowed.Body) { + public init(body: Operations.UpdateGroupChat.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.ListGroupChats.Output.MethodNotAllowed) + case methodNotAllowed(Operations.UpdateGroupChat.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.ListGroupChats.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.UpdateGroupChat.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -51566,9 +56580,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51584,26 +56598,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.Conflict.Body + public var body: Operations.UpdateGroupChat.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.Conflict.Body) { + public init(body: Operations.UpdateGroupChat.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.ListGroupChats.Output.Conflict) + case conflict(Operations.UpdateGroupChat.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.ListGroupChats.Output.Conflict { + public var conflict: Operations.UpdateGroupChat.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -51617,9 +56631,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -51635,26 +56649,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.ContentTooLarge.Body + public var body: Operations.UpdateGroupChat.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.ContentTooLarge.Body) { + public init(body: Operations.UpdateGroupChat.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.ListGroupChats.Output.ContentTooLarge) + case contentTooLarge(Operations.UpdateGroupChat.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.ListGroupChats.Output.ContentTooLarge { + public var contentTooLarge: Operations.UpdateGroupChat.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -51668,9 +56682,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51686,26 +56700,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.InternalServerError.Body + public var body: Operations.UpdateGroupChat.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.InternalServerError.Body) { + public init(body: Operations.UpdateGroupChat.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.ListGroupChats.Output.InternalServerError) + case internalServerError(Operations.UpdateGroupChat.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.ListGroupChats.Output.InternalServerError { + public var internalServerError: Operations.UpdateGroupChat.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -51719,9 +56733,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51737,26 +56751,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.ListGroupChats.Output.ServiceUnavailable.Body + public var body: Operations.UpdateGroupChat.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.ListGroupChats.Output.ServiceUnavailable.Body) { + public init(body: Operations.UpdateGroupChat.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/get(listGroupChats)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.ListGroupChats.Output.ServiceUnavailable) + case serviceUnavailable(Operations.UpdateGroupChat.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.ListGroupChats.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.UpdateGroupChat.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -51806,121 +56820,89 @@ public enum Operations { } } } - /// - Remark: HTTP `POST /v1/group-chats`. - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)`. - public enum CreateGroupChat { - public static let id: Swift.String = "createGroupChat" + /// - Remark: HTTP `DELETE /v1/group-chats/{id}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)`. + public enum DeleteGroupChat { + public static let id: Swift.String = "deleteGroupChat" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/header`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/path`. + public struct Path: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/path/id`. + public var id: Swift.String + /// Creates a new `Path`. + /// + /// - Parameters: + /// - id: + public init(id: Swift.String) { + self.id = id + } + } + public var path: Operations.DeleteGroupChat.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.CreateGroupChat.Input.Headers - /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/json/memberIds`. - public var memberIds: [Swift.String] - /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/json/name`. - public var name: Swift.String - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - memberIds: - /// - name: - public init( - memberIds: [Swift.String], - name: Swift.String - ) { - self.memberIds = memberIds - self.name = name - } - public enum CodingKeys: String, CodingKey { - case memberIds - case name - } - } - /// - Remark: Generated from `#/paths/v1/group-chats/POST/requestBody/content/application\/json`. - case json(Operations.CreateGroupChat.Input.Body.JsonPayload) - } - public var body: Operations.CreateGroupChat.Input.Body + public var headers: Operations.DeleteGroupChat.Input.Headers /// Creates a new `Input`. /// /// - Parameters: + /// - path: /// - headers: - /// - body: public init( - headers: Operations.CreateGroupChat.Input.Headers = .init(), - body: Operations.CreateGroupChat.Input.Body + path: Operations.DeleteGroupChat.Input.Path, + headers: Operations.DeleteGroupChat.Input.Headers = .init() ) { + self.path = path self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Created: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/201/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/201/content/application\/json`. - case json(Components.Schemas.GroupChat) - /// The associated value of the enum case if `self` is `.json`. - /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GroupChat { - get throws { - switch self { - case let .json(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.Created.Body - /// Creates a new `Created`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.Created.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// Success + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/201`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/204`. /// - /// HTTP response code: `201 created`. - case created(Operations.CreateGroupChat.Output.Created) - /// The associated value of the enum case if `self` is `.created`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteGroupChat.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.created`. - /// - SeeAlso: `.created`. - public var created: Operations.CreateGroupChat.Output.Created { + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteGroupChat.Output.NoContent { get throws { switch self { - case let .created(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "created", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -51936,26 +56918,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.BadRequest.Body + public var body: Operations.DeleteGroupChat.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.BadRequest.Body) { + public init(body: Operations.DeleteGroupChat.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.CreateGroupChat.Output.BadRequest) + case badRequest(Operations.DeleteGroupChat.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.CreateGroupChat.Output.BadRequest { + public var badRequest: Operations.DeleteGroupChat.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -51969,9 +56951,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -51987,26 +56969,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.Unauthorized.Body + public var body: Operations.DeleteGroupChat.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.Unauthorized.Body) { + public init(body: Operations.DeleteGroupChat.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.CreateGroupChat.Output.Unauthorized) + case unauthorized(Operations.DeleteGroupChat.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.CreateGroupChat.Output.Unauthorized { + public var unauthorized: Operations.DeleteGroupChat.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -52020,9 +57002,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52038,26 +57020,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.NotFound.Body + public var body: Operations.DeleteGroupChat.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.NotFound.Body) { + public init(body: Operations.DeleteGroupChat.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.CreateGroupChat.Output.NotFound) + case notFound(Operations.DeleteGroupChat.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.CreateGroupChat.Output.NotFound { + public var notFound: Operations.DeleteGroupChat.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -52071,9 +57053,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52089,26 +57071,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.MethodNotAllowed.Body + public var body: Operations.DeleteGroupChat.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteGroupChat.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.CreateGroupChat.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteGroupChat.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.CreateGroupChat.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteGroupChat.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -52122,9 +57104,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52140,26 +57122,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.Conflict.Body + public var body: Operations.DeleteGroupChat.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.Conflict.Body) { + public init(body: Operations.DeleteGroupChat.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.CreateGroupChat.Output.Conflict) + case conflict(Operations.DeleteGroupChat.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.CreateGroupChat.Output.Conflict { + public var conflict: Operations.DeleteGroupChat.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -52173,9 +57155,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -52191,26 +57173,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.ContentTooLarge.Body + public var body: Operations.DeleteGroupChat.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteGroupChat.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.CreateGroupChat.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteGroupChat.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.CreateGroupChat.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteGroupChat.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -52224,9 +57206,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52242,26 +57224,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.InternalServerError.Body + public var body: Operations.DeleteGroupChat.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.InternalServerError.Body) { + public init(body: Operations.DeleteGroupChat.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.CreateGroupChat.Output.InternalServerError) + case internalServerError(Operations.DeleteGroupChat.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.CreateGroupChat.Output.InternalServerError { + public var internalServerError: Operations.DeleteGroupChat.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -52275,9 +57257,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/POST/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52293,26 +57275,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.CreateGroupChat.Output.ServiceUnavailable.Body + public var body: Operations.DeleteGroupChat.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.CreateGroupChat.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteGroupChat.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/post(createGroupChat)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.CreateGroupChat.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteGroupChat.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.CreateGroupChat.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteGroupChat.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -52362,14 +57344,14 @@ public enum Operations { } } } - /// - Remark: HTTP `GET /v1/group-chats/{id}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)`. - public enum GetGroupChat { - public static let id: Swift.String = "getGroupChat" + /// - Remark: HTTP `GET /v1/group-chats/{id}/chat`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)`. + public enum GetGroupChatSnapshot { + public static let id: Swift.String = "getGroupChatSnapshot" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -52379,43 +57361,59 @@ public enum Operations { self.id = id } } - public var path: Operations.GetGroupChat.Input.Path - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/header`. + public var path: Operations.GetGroupChatSnapshot.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/query/limit`. + public var limit: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - limit: + public init(limit: Swift.Int? = nil) { + self.limit = limit + } + } + public var query: Operations.GetGroupChatSnapshot.Input.Query + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.GetGroupChat.Input.Headers + public var headers: Operations.GetGroupChatSnapshot.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.GetGroupChat.Input.Path, - headers: Operations.GetGroupChat.Input.Headers = .init() + path: Operations.GetGroupChatSnapshot.Input.Path, + query: Operations.GetGroupChatSnapshot.Input.Query = .init(), + headers: Operations.GetGroupChatSnapshot.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/200/content/application\/json`. - case json(Components.Schemas.GroupChat) + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/200/content/application\/json`. + case json(Components.Schemas.GroupChatSnapshot) /// The associated value of the enum case if `self` is `.json`. /// /// - Throws: An error if `self` is not `.json`. /// - SeeAlso: `.json`. - public var json: Components.Schemas.GroupChat { + public var json: Components.Schemas.GroupChatSnapshot { get throws { switch self { case let .json(body): @@ -52425,26 +57423,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.Ok.Body + public var body: Operations.GetGroupChatSnapshot.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.Ok.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.Ok.Body) { self.body = body } } /// Success /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.GetGroupChat.Output.Ok) + case ok(Operations.GetGroupChatSnapshot.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.GetGroupChat.Output.Ok { + public var ok: Operations.GetGroupChatSnapshot.Output.Ok { get throws { switch self { case let .ok(response): @@ -52458,9 +57456,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52476,26 +57474,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.BadRequest.Body + public var body: Operations.GetGroupChatSnapshot.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.BadRequest.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.GetGroupChat.Output.BadRequest) + case badRequest(Operations.GetGroupChatSnapshot.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.GetGroupChat.Output.BadRequest { + public var badRequest: Operations.GetGroupChatSnapshot.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -52509,9 +57507,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -52527,26 +57525,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.Unauthorized.Body + public var body: Operations.GetGroupChatSnapshot.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.Unauthorized.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.GetGroupChat.Output.Unauthorized) + case unauthorized(Operations.GetGroupChatSnapshot.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.GetGroupChat.Output.Unauthorized { + public var unauthorized: Operations.GetGroupChatSnapshot.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -52560,9 +57558,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52578,26 +57576,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.NotFound.Body + public var body: Operations.GetGroupChatSnapshot.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.NotFound.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.GetGroupChat.Output.NotFound) + case notFound(Operations.GetGroupChatSnapshot.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.GetGroupChat.Output.NotFound { + public var notFound: Operations.GetGroupChatSnapshot.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -52611,9 +57609,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52629,26 +57627,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.MethodNotAllowed.Body + public var body: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.MethodNotAllowed.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.GetGroupChat.Output.MethodNotAllowed) + case methodNotAllowed(Operations.GetGroupChatSnapshot.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.GetGroupChat.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -52662,9 +57660,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52680,26 +57678,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.Conflict.Body + public var body: Operations.GetGroupChatSnapshot.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.Conflict.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.GetGroupChat.Output.Conflict) + case conflict(Operations.GetGroupChatSnapshot.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.GetGroupChat.Output.Conflict { + public var conflict: Operations.GetGroupChatSnapshot.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -52713,9 +57711,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -52731,26 +57729,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.ContentTooLarge.Body + public var body: Operations.GetGroupChatSnapshot.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.ContentTooLarge.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.GetGroupChat.Output.ContentTooLarge) + case contentTooLarge(Operations.GetGroupChatSnapshot.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.GetGroupChat.Output.ContentTooLarge { + public var contentTooLarge: Operations.GetGroupChatSnapshot.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -52764,9 +57762,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52782,26 +57780,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.InternalServerError.Body + public var body: Operations.GetGroupChatSnapshot.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.InternalServerError.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.GetGroupChat.Output.InternalServerError) + case internalServerError(Operations.GetGroupChatSnapshot.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.GetGroupChat.Output.InternalServerError { + public var internalServerError: Operations.GetGroupChatSnapshot.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -52815,9 +57813,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -52833,26 +57831,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChat.Output.ServiceUnavailable.Body + public var body: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChat.Output.ServiceUnavailable.Body) { + public init(body: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/get(getGroupChat)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.GetGroupChat.Output.ServiceUnavailable) + case serviceUnavailable(Operations.GetGroupChatSnapshot.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.GetGroupChat.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -52902,14 +57900,16 @@ public enum Operations { } } } - /// - Remark: HTTP `PATCH /v1/group-chats/{id}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)`. - public enum UpdateGroupChat { - public static let id: Swift.String = "updateGroupChat" + /// Server-sent events. Each snapshot event carries a GroupChatSnapshot JSON object in data, sent on connection and after every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay. + /// + /// - Remark: HTTP `GET /v1/group-chats/{id}/events`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)`. + public enum StreamGroupChatEvents { + public static let id: Swift.String = "streamGroupChatEvents" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -52919,104 +57919,88 @@ public enum Operations { self.id = id } } - public var path: Operations.UpdateGroupChat.Input.Path - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/header`. + public var path: Operations.StreamGroupChatEvents.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/query/limit`. + public var limit: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - limit: + public init(limit: Swift.Int? = nil) { + self.limit = limit + } + } + public var query: Operations.StreamGroupChatEvents.Input.Query + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.UpdateGroupChat.Input.Headers - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/json`. - public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/json/memberIds`. - public var memberIds: [Swift.String]? - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/json/name`. - public var name: Swift.String? - /// Creates a new `JsonPayload`. - /// - /// - Parameters: - /// - memberIds: - /// - name: - public init( - memberIds: [Swift.String]? = nil, - name: Swift.String? = nil - ) { - self.memberIds = memberIds - self.name = name - } - public enum CodingKeys: String, CodingKey { - case memberIds - case name - } - } - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/requestBody/content/application\/json`. - case json(Operations.UpdateGroupChat.Input.Body.JsonPayload) - } - public var body: Operations.UpdateGroupChat.Input.Body + public var headers: Operations.StreamGroupChatEvents.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: - /// - body: public init( - path: Operations.UpdateGroupChat.Input.Path, - headers: Operations.UpdateGroupChat.Input.Headers = .init(), - body: Operations.UpdateGroupChat.Input.Body + path: Operations.StreamGroupChatEvents.Input.Path, + query: Operations.StreamGroupChatEvents.Input.Query = .init(), + headers: Operations.StreamGroupChatEvents.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers - self.body = body } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/200/content/application\/json`. - case json(Components.Schemas.GroupChat) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/200/content/text\/event-stream`. + case textEventStream(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.textEventStream`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GroupChat { + /// - Throws: An error if `self` is not `.textEventStream`. + /// - SeeAlso: `.textEventStream`. + public var textEventStream: OpenAPIRuntime.HTTPBody { get throws { switch self { - case let .json(body): + case let .textEventStream(body): return body } } } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.Ok.Body + public var body: Operations.StreamGroupChatEvents.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.Ok.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.Ok.Body) { self.body = body } } - /// Success + /// SSE stream, not a JSON array /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.UpdateGroupChat.Output.Ok) + case ok(Operations.StreamGroupChatEvents.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.UpdateGroupChat.Output.Ok { + public var ok: Operations.StreamGroupChatEvents.Output.Ok { get throws { switch self { case let .ok(response): @@ -53030,9 +58014,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53048,26 +58032,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.BadRequest.Body + public var body: Operations.StreamGroupChatEvents.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.BadRequest.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.UpdateGroupChat.Output.BadRequest) + case badRequest(Operations.StreamGroupChatEvents.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.UpdateGroupChat.Output.BadRequest { + public var badRequest: Operations.StreamGroupChatEvents.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -53081,9 +58065,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -53099,26 +58083,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.Unauthorized.Body + public var body: Operations.StreamGroupChatEvents.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.Unauthorized.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.UpdateGroupChat.Output.Unauthorized) + case unauthorized(Operations.StreamGroupChatEvents.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.UpdateGroupChat.Output.Unauthorized { + public var unauthorized: Operations.StreamGroupChatEvents.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -53132,9 +58116,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53150,26 +58134,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.NotFound.Body + public var body: Operations.StreamGroupChatEvents.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.NotFound.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.UpdateGroupChat.Output.NotFound) + case notFound(Operations.StreamGroupChatEvents.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.UpdateGroupChat.Output.NotFound { + public var notFound: Operations.StreamGroupChatEvents.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -53183,9 +58167,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53201,26 +58185,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.MethodNotAllowed.Body + public var body: Operations.StreamGroupChatEvents.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.MethodNotAllowed.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.UpdateGroupChat.Output.MethodNotAllowed) + case methodNotAllowed(Operations.StreamGroupChatEvents.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.UpdateGroupChat.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.StreamGroupChatEvents.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -53234,9 +58218,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53252,26 +58236,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.Conflict.Body + public var body: Operations.StreamGroupChatEvents.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.Conflict.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.UpdateGroupChat.Output.Conflict) + case conflict(Operations.StreamGroupChatEvents.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.UpdateGroupChat.Output.Conflict { + public var conflict: Operations.StreamGroupChatEvents.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -53285,9 +58269,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -53303,26 +58287,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.ContentTooLarge.Body + public var body: Operations.StreamGroupChatEvents.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.ContentTooLarge.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.UpdateGroupChat.Output.ContentTooLarge) + case contentTooLarge(Operations.StreamGroupChatEvents.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.UpdateGroupChat.Output.ContentTooLarge { + public var contentTooLarge: Operations.StreamGroupChatEvents.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -53336,9 +58320,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53354,26 +58338,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.InternalServerError.Body + public var body: Operations.StreamGroupChatEvents.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.InternalServerError.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.UpdateGroupChat.Output.InternalServerError) + case internalServerError(Operations.StreamGroupChatEvents.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.UpdateGroupChat.Output.InternalServerError { + public var internalServerError: Operations.StreamGroupChatEvents.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -53387,9 +58371,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/PATCH/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53405,26 +58389,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.UpdateGroupChat.Output.ServiceUnavailable.Body + public var body: Operations.StreamGroupChatEvents.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.UpdateGroupChat.Output.ServiceUnavailable.Body) { + public init(body: Operations.StreamGroupChatEvents.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/patch(updateGroupChat)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.UpdateGroupChat.Output.ServiceUnavailable) + case serviceUnavailable(Operations.StreamGroupChatEvents.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.UpdateGroupChat.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.StreamGroupChatEvents.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -53443,11 +58427,14 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { + case textEventStream case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { + case "text/event-stream": + self = .textEventStream case "application/json": self = .json case "text/plain": @@ -53460,6 +58447,8 @@ public enum Operations { switch self { case let .other(string): return string + case .textEventStream: + return "text/event-stream" case .json: return "application/json" case .plainText: @@ -53468,20 +58457,21 @@ public enum Operations { } public static var allCases: [Self] { [ + .textEventStream, .json, .plainText ] } } } - /// - Remark: HTTP `DELETE /v1/group-chats/{id}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)`. - public enum DeleteGroupChat { - public static let id: Swift.String = "deleteGroupChat" + /// - Remark: HTTP `GET /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)`. + public enum ListGroupFiles { + public static let id: Swift.String = "listGroupFiles" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/path/id`. public var id: Swift.String /// Creates a new `Path`. /// @@ -53491,72 +58481,111 @@ public enum Operations { self.id = id } } - public var path: Operations.DeleteGroupChat.Input.Path - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/header`. + public var path: Operations.ListGroupFiles.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/query`. + public struct Query: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/query/before`. + public var before: Swift.String? + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/query/limit`. + public var limit: Swift.Int? + /// Creates a new `Query`. + /// + /// - Parameters: + /// - before: + /// - limit: + public init( + before: Swift.String? = nil, + limit: Swift.Int? = nil + ) { + self.before = before + self.limit = limit + } + } + public var query: Operations.ListGroupFiles.Input.Query + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.DeleteGroupChat.Input.Headers + public var headers: Operations.ListGroupFiles.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: + /// - query: /// - headers: public init( - path: Operations.DeleteGroupChat.Input.Path, - headers: Operations.DeleteGroupChat.Input.Headers = .init() + path: Operations.ListGroupFiles.Input.Path, + query: Operations.ListGroupFiles.Input.Query = .init(), + headers: Operations.ListGroupFiles.Input.Headers = .init() ) { self.path = path + self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/200/content/application\/json`. + case json([Components.Schemas.LibraryFile]) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: [Components.Schemas.LibraryFile] { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.ListGroupFiles.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.ListGroupFiles.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/204`. + /// Success /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.DeleteGroupChat.Output.NoContent) - /// Success, no response body + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/200`. /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.ListGroupFiles.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.DeleteGroupChat.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.ListGroupFiles.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53572,26 +58601,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.BadRequest.Body + public var body: Operations.ListGroupFiles.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.BadRequest.Body) { + public init(body: Operations.ListGroupFiles.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.DeleteGroupChat.Output.BadRequest) + case badRequest(Operations.ListGroupFiles.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.DeleteGroupChat.Output.BadRequest { + public var badRequest: Operations.ListGroupFiles.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -53605,9 +58634,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -53623,26 +58652,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.Unauthorized.Body + public var body: Operations.ListGroupFiles.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.Unauthorized.Body) { + public init(body: Operations.ListGroupFiles.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.DeleteGroupChat.Output.Unauthorized) + case unauthorized(Operations.ListGroupFiles.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.DeleteGroupChat.Output.Unauthorized { + public var unauthorized: Operations.ListGroupFiles.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -53656,9 +58685,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53674,26 +58703,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.NotFound.Body + public var body: Operations.ListGroupFiles.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.NotFound.Body) { + public init(body: Operations.ListGroupFiles.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.DeleteGroupChat.Output.NotFound) + case notFound(Operations.ListGroupFiles.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.DeleteGroupChat.Output.NotFound { + public var notFound: Operations.ListGroupFiles.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -53707,9 +58736,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53725,26 +58754,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.MethodNotAllowed.Body + public var body: Operations.ListGroupFiles.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.MethodNotAllowed.Body) { + public init(body: Operations.ListGroupFiles.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.DeleteGroupChat.Output.MethodNotAllowed) + case methodNotAllowed(Operations.ListGroupFiles.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.DeleteGroupChat.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.ListGroupFiles.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -53758,9 +58787,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53776,26 +58805,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.Conflict.Body + public var body: Operations.ListGroupFiles.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.Conflict.Body) { + public init(body: Operations.ListGroupFiles.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.DeleteGroupChat.Output.Conflict) + case conflict(Operations.ListGroupFiles.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.DeleteGroupChat.Output.Conflict { + public var conflict: Operations.ListGroupFiles.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -53809,9 +58838,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -53827,26 +58856,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.ContentTooLarge.Body + public var body: Operations.ListGroupFiles.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.ContentTooLarge.Body) { + public init(body: Operations.ListGroupFiles.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.DeleteGroupChat.Output.ContentTooLarge) + case contentTooLarge(Operations.ListGroupFiles.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.DeleteGroupChat.Output.ContentTooLarge { + public var contentTooLarge: Operations.ListGroupFiles.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -53860,9 +58889,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53878,26 +58907,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.InternalServerError.Body + public var body: Operations.ListGroupFiles.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.InternalServerError.Body) { + public init(body: Operations.ListGroupFiles.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.DeleteGroupChat.Output.InternalServerError) + case internalServerError(Operations.ListGroupFiles.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.DeleteGroupChat.Output.InternalServerError { + public var internalServerError: Operations.ListGroupFiles.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -53911,9 +58940,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/DELETE/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -53929,26 +58958,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.DeleteGroupChat.Output.ServiceUnavailable.Body + public var body: Operations.ListGroupFiles.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.DeleteGroupChat.Output.ServiceUnavailable.Body) { + public init(body: Operations.ListGroupFiles.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.DeleteGroupChat.Output.ServiceUnavailable) + case serviceUnavailable(Operations.ListGroupFiles.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.DeleteGroupChat.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.ListGroupFiles.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -53998,138 +59027,121 @@ public enum Operations { } } } - /// - Remark: HTTP `GET /v1/group-chats/{id}/attachments/{entryId}/{index}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)`. - public enum GetGroupAttachment { - public static let id: Swift.String = "getGroupAttachment" + /// - Remark: HTTP `POST /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)`. + public enum UploadGroupFile { + public static let id: Swift.String = "uploadGroupFile" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/path/id`. public var id: Swift.String - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/path/entryId`. - public var entryId: Swift.String - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/path/index`. - public var index: Swift.Int /// Creates a new `Path`. /// /// - Parameters: /// - id: - /// - entryId: - /// - index: - public init( - id: Swift.String, - entryId: Swift.String, - index: Swift.Int - ) { + public init(id: Swift.String) { self.id = id - self.entryId = entryId - self.index = index } } - public var path: Operations.GetGroupAttachment.Input.Path - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/header`. + public var path: Operations.UploadGroupFile.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/header/x-file-name`. + public var xFileName: Swift.String + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: + /// - xFileName: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init( + xFileName: Swift.String, + accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues() + ) { + self.xFileName = xFileName self.accept = accept } } - public var headers: Operations.GetGroupAttachment.Input.Headers + public var headers: Operations.UploadGroupFile.Input.Headers + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/requestBody/content/*\/*`. + case any(OpenAPIRuntime.HTTPBody) + } + public var body: Operations.UploadGroupFile.Input.Body /// Creates a new `Input`. /// /// - Parameters: /// - path: /// - headers: + /// - body: public init( - path: Operations.GetGroupAttachment.Input.Path, - headers: Operations.GetGroupAttachment.Input.Headers = .init() + path: Operations.UploadGroupFile.Input.Path, + headers: Operations.UploadGroupFile.Input.Headers, + body: Operations.UploadGroupFile.Input.Body ) { self.path = path self.headers = headers + self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/200/headers`. - public struct Headers: Sendable, Hashable { - /// private, max-age=31536000, immutable - /// - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/200/headers/Cache-Control`. - public var cacheControl: Swift.String? - /// Creates a new `Headers`. - /// - /// - Parameters: - /// - cacheControl: private, max-age=31536000, immutable - public init(cacheControl: Swift.String? = nil) { - self.cacheControl = cacheControl - } - } - /// Received HTTP response headers - public var headers: Operations.GetGroupAttachment.Output.Ok.Headers - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/200/content`. + public struct Created: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/201/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/200/content/*\/*`. - case any(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.any`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/201/content/application\/json`. + case json(Components.Schemas.UploadFile) + /// The associated value of the enum case if `self` is `.json`. /// - /// - Throws: An error if `self` is not `.any`. - /// - SeeAlso: `.any`. - public var any: OpenAPIRuntime.HTTPBody { + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.UploadFile { get throws { switch self { - case let .any(body): + case let .json(body): return body } } } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.Ok.Body - /// Creates a new `Ok`. + public var body: Operations.UploadGroupFile.Output.Created.Body + /// Creates a new `Created`. /// /// - Parameters: - /// - headers: Received HTTP response headers /// - body: Received HTTP response body - public init( - headers: Operations.GetGroupAttachment.Output.Ok.Headers = .init(), - body: Operations.GetGroupAttachment.Output.Ok.Body - ) { - self.headers = headers + public init(body: Operations.UploadGroupFile.Output.Created.Body) { self.body = body } } - /// Attachment bytes; Content-Type identifies the image or text format + /// Success /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/201`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.GetGroupAttachment.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `201 created`. + case created(Operations.UploadGroupFile.Output.Created) + /// The associated value of the enum case if `self` is `.created`. /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.GetGroupAttachment.Output.Ok { + /// - Throws: An error if `self` is not `.created`. + /// - SeeAlso: `.created`. + public var created: Operations.UploadGroupFile.Output.Created { get throws { switch self { - case let .ok(response): + case let .created(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "created", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54145,26 +59157,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.BadRequest.Body + public var body: Operations.UploadGroupFile.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.BadRequest.Body) { + public init(body: Operations.UploadGroupFile.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.GetGroupAttachment.Output.BadRequest) + case badRequest(Operations.UploadGroupFile.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.GetGroupAttachment.Output.BadRequest { + public var badRequest: Operations.UploadGroupFile.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -54178,9 +59190,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -54196,26 +59208,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.Unauthorized.Body + public var body: Operations.UploadGroupFile.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.Unauthorized.Body) { + public init(body: Operations.UploadGroupFile.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.GetGroupAttachment.Output.Unauthorized) + case unauthorized(Operations.UploadGroupFile.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.GetGroupAttachment.Output.Unauthorized { + public var unauthorized: Operations.UploadGroupFile.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -54229,9 +59241,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54247,26 +59259,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.NotFound.Body + public var body: Operations.UploadGroupFile.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.NotFound.Body) { + public init(body: Operations.UploadGroupFile.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.GetGroupAttachment.Output.NotFound) + case notFound(Operations.UploadGroupFile.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.GetGroupAttachment.Output.NotFound { + public var notFound: Operations.UploadGroupFile.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -54280,9 +59292,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54298,26 +59310,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.MethodNotAllowed.Body + public var body: Operations.UploadGroupFile.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.MethodNotAllowed.Body) { + public init(body: Operations.UploadGroupFile.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.GetGroupAttachment.Output.MethodNotAllowed) + case methodNotAllowed(Operations.UploadGroupFile.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.GetGroupAttachment.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.UploadGroupFile.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -54331,9 +59343,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54349,26 +59361,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.Conflict.Body + public var body: Operations.UploadGroupFile.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.Conflict.Body) { + public init(body: Operations.UploadGroupFile.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.GetGroupAttachment.Output.Conflict) + case conflict(Operations.UploadGroupFile.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.GetGroupAttachment.Output.Conflict { + public var conflict: Operations.UploadGroupFile.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -54382,9 +59394,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -54400,26 +59412,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.ContentTooLarge.Body + public var body: Operations.UploadGroupFile.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.ContentTooLarge.Body) { + public init(body: Operations.UploadGroupFile.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.GetGroupAttachment.Output.ContentTooLarge) + case contentTooLarge(Operations.UploadGroupFile.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.GetGroupAttachment.Output.ContentTooLarge { + public var contentTooLarge: Operations.UploadGroupFile.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -54433,9 +59445,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54451,26 +59463,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.InternalServerError.Body + public var body: Operations.UploadGroupFile.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.InternalServerError.Body) { + public init(body: Operations.UploadGroupFile.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.GetGroupAttachment.Output.InternalServerError) + case internalServerError(Operations.UploadGroupFile.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.GetGroupAttachment.Output.InternalServerError { + public var internalServerError: Operations.UploadGroupFile.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -54484,9 +59496,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/attachments/{entryId}/{index}/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54502,26 +59514,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupAttachment.Output.ServiceUnavailable.Body + public var body: Operations.UploadGroupFile.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupAttachment.Output.ServiceUnavailable.Body) { + public init(body: Operations.UploadGroupFile.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.GetGroupAttachment.Output.ServiceUnavailable) + case serviceUnavailable(Operations.UploadGroupFile.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.GetGroupAttachment.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.UploadGroupFile.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -54540,14 +59552,11 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { - case any case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { - case "*/*": - self = .any case "application/json": self = .json case "text/plain": @@ -54560,8 +59569,6 @@ public enum Operations { switch self { case let .other(string): return string - case .any: - return "*/*" case .json: return "application/json" case .plainText: @@ -54570,112 +59577,102 @@ public enum Operations { } public static var allCases: [Self] { [ - .any, .json, .plainText ] } } } - /// - Remark: HTTP `GET /v1/group-chats/{id}/chat`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)`. - public enum GetGroupChatSnapshot { - public static let id: Swift.String = "getGroupChatSnapshot" + /// - Remark: HTTP `GET /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)`. + public enum GetGroupFile { + public static let id: Swift.String = "getGroupFile" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/path/id`. public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/path/fileId`. + public var fileId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - public init(id: Swift.String) { + /// - fileId: + public init( + id: Swift.String, + fileId: Swift.String + ) { self.id = id + self.fileId = fileId } } - public var path: Operations.GetGroupChatSnapshot.Input.Path - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/query/limit`. - public var limit: Swift.Int? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - limit: - public init(limit: Swift.Int? = nil) { - self.limit = limit - } - } - public var query: Operations.GetGroupChatSnapshot.Input.Query - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/header`. + public var path: Operations.GetGroupFile.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.GetGroupChatSnapshot.Input.Headers + public var headers: Operations.GetGroupFile.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.GetGroupChatSnapshot.Input.Path, - query: Operations.GetGroupChatSnapshot.Input.Query = .init(), - headers: Operations.GetGroupChatSnapshot.Input.Headers = .init() + path: Operations.GetGroupFile.Input.Path, + headers: Operations.GetGroupFile.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/200/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/200/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/200/content/application\/json`. - case json(Components.Schemas.GroupChatSnapshot) - /// The associated value of the enum case if `self` is `.json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/200/content/application\/octet-stream`. + case binary(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.binary`. /// - /// - Throws: An error if `self` is not `.json`. - /// - SeeAlso: `.json`. - public var json: Components.Schemas.GroupChatSnapshot { + /// - Throws: An error if `self` is not `.binary`. + /// - SeeAlso: `.binary`. + public var binary: OpenAPIRuntime.HTTPBody { get throws { switch self { - case let .json(body): + case let .binary(body): return body } } } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.Ok.Body + public var body: Operations.GetGroupFile.Output.Ok.Body /// Creates a new `Ok`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.Ok.Body) { + public init(body: Operations.GetGroupFile.Output.Ok.Body) { self.body = body } } - /// Success + /// File bytes with safe download headers /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/200`. /// /// HTTP response code: `200 ok`. - case ok(Operations.GetGroupChatSnapshot.Output.Ok) + case ok(Operations.GetGroupFile.Output.Ok) /// The associated value of the enum case if `self` is `.ok`. /// /// - Throws: An error if `self` is not `.ok`. /// - SeeAlso: `.ok`. - public var ok: Operations.GetGroupChatSnapshot.Output.Ok { + public var ok: Operations.GetGroupFile.Output.Ok { get throws { switch self { case let .ok(response): @@ -54689,9 +59686,9 @@ public enum Operations { } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54707,26 +59704,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.BadRequest.Body + public var body: Operations.GetGroupFile.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.BadRequest.Body) { + public init(body: Operations.GetGroupFile.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.GetGroupChatSnapshot.Output.BadRequest) + case badRequest(Operations.GetGroupFile.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.GetGroupChatSnapshot.Output.BadRequest { + public var badRequest: Operations.GetGroupFile.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -54740,9 +59737,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -54758,26 +59755,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.Unauthorized.Body + public var body: Operations.GetGroupFile.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.Unauthorized.Body) { + public init(body: Operations.GetGroupFile.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.GetGroupChatSnapshot.Output.Unauthorized) + case unauthorized(Operations.GetGroupFile.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.GetGroupChatSnapshot.Output.Unauthorized { + public var unauthorized: Operations.GetGroupFile.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -54791,9 +59788,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54809,26 +59806,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.NotFound.Body + public var body: Operations.GetGroupFile.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.NotFound.Body) { + public init(body: Operations.GetGroupFile.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.GetGroupChatSnapshot.Output.NotFound) + case notFound(Operations.GetGroupFile.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.GetGroupChatSnapshot.Output.NotFound { + public var notFound: Operations.GetGroupFile.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -54842,9 +59839,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54860,26 +59857,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed.Body + public var body: Operations.GetGroupFile.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed.Body) { + public init(body: Operations.GetGroupFile.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.GetGroupChatSnapshot.Output.MethodNotAllowed) + case methodNotAllowed(Operations.GetGroupFile.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.GetGroupChatSnapshot.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.GetGroupFile.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -54893,9 +59890,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -54911,26 +59908,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.Conflict.Body + public var body: Operations.GetGroupFile.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.Conflict.Body) { + public init(body: Operations.GetGroupFile.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.GetGroupChatSnapshot.Output.Conflict) + case conflict(Operations.GetGroupFile.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.GetGroupChatSnapshot.Output.Conflict { + public var conflict: Operations.GetGroupFile.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -54944,9 +59941,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -54962,26 +59959,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.ContentTooLarge.Body + public var body: Operations.GetGroupFile.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.ContentTooLarge.Body) { + public init(body: Operations.GetGroupFile.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.GetGroupChatSnapshot.Output.ContentTooLarge) + case contentTooLarge(Operations.GetGroupFile.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.GetGroupChatSnapshot.Output.ContentTooLarge { + public var contentTooLarge: Operations.GetGroupFile.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -54995,9 +59992,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55013,26 +60010,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.InternalServerError.Body + public var body: Operations.GetGroupFile.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.InternalServerError.Body) { + public init(body: Operations.GetGroupFile.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.GetGroupChatSnapshot.Output.InternalServerError) + case internalServerError(Operations.GetGroupFile.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.GetGroupChatSnapshot.Output.InternalServerError { + public var internalServerError: Operations.GetGroupFile.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -55046,9 +60043,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/chat/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/GET/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55064,26 +60061,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable.Body + public var body: Operations.GetGroupFile.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable.Body) { + public init(body: Operations.GetGroupFile.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.GetGroupChatSnapshot.Output.ServiceUnavailable) + case serviceUnavailable(Operations.GetGroupFile.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.GetGroupChatSnapshot.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.GetGroupFile.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -55102,11 +60099,14 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { + case binary case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { + case "application/octet-stream": + self = .binary case "application/json": self = .json case "text/plain": @@ -55119,6 +60119,8 @@ public enum Operations { switch self { case let .other(string): return string + case .binary: + return "application/octet-stream" case .json: return "application/json" case .plainText: @@ -55127,129 +60129,103 @@ public enum Operations { } public static var allCases: [Self] { [ + .binary, .json, .plainText ] } } } - /// Server-sent events. Each snapshot event carries a GroupChatSnapshot JSON object in data, sent on connection and after every change. Heartbeat events carry {} every 15 seconds. Authenticate with the Authorization header. Reconnect by fetching the current snapshot; there is no Last-Event-ID replay. - /// - /// - Remark: HTTP `GET /v1/group-chats/{id}/events`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)`. - public enum StreamGroupChatEvents { - public static let id: Swift.String = "streamGroupChatEvents" + /// - Remark: HTTP `DELETE /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)`. + public enum DeleteGroupFile { + public static let id: Swift.String = "deleteGroupFile" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/path`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/path`. public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/path/id`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/path/id`. public var id: Swift.String + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/path/fileId`. + public var fileId: Swift.String /// Creates a new `Path`. /// /// - Parameters: /// - id: - public init(id: Swift.String) { + /// - fileId: + public init( + id: Swift.String, + fileId: Swift.String + ) { self.id = id + self.fileId = fileId } } - public var path: Operations.StreamGroupChatEvents.Input.Path - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/query`. - public struct Query: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/query/limit`. - public var limit: Swift.Int? - /// Creates a new `Query`. - /// - /// - Parameters: - /// - limit: - public init(limit: Swift.Int? = nil) { - self.limit = limit - } - } - public var query: Operations.StreamGroupChatEvents.Input.Query - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/header`. + public var path: Operations.DeleteGroupFile.Input.Path + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.StreamGroupChatEvents.Input.Headers + public var headers: Operations.DeleteGroupFile.Input.Headers /// Creates a new `Input`. /// /// - Parameters: /// - path: - /// - query: /// - headers: public init( - path: Operations.StreamGroupChatEvents.Input.Path, - query: Operations.StreamGroupChatEvents.Input.Query = .init(), - headers: Operations.StreamGroupChatEvents.Input.Headers = .init() + path: Operations.DeleteGroupFile.Input.Path, + headers: Operations.DeleteGroupFile.Input.Headers = .init() ) { self.path = path - self.query = query self.headers = headers } } @frozen public enum Output: Sendable, Hashable { - public struct Ok: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/200/content`. - @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/200/content/text\/event-stream`. - case textEventStream(OpenAPIRuntime.HTTPBody) - /// The associated value of the enum case if `self` is `.textEventStream`. - /// - /// - Throws: An error if `self` is not `.textEventStream`. - /// - SeeAlso: `.textEventStream`. - public var textEventStream: OpenAPIRuntime.HTTPBody { - get throws { - switch self { - case let .textEventStream(body): - return body - } - } - } - } - /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.Ok.Body - /// Creates a new `Ok`. - /// - /// - Parameters: - /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.Ok.Body) { - self.body = body - } + public struct NoContent: Sendable, Hashable { + /// Creates a new `NoContent`. + public init() {} } - /// SSE stream, not a JSON array + /// Success, no response body /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/200`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/204`. /// - /// HTTP response code: `200 ok`. - case ok(Operations.StreamGroupChatEvents.Output.Ok) - /// The associated value of the enum case if `self` is `.ok`. + /// HTTP response code: `204 noContent`. + case noContent(Operations.DeleteGroupFile.Output.NoContent) + /// Success, no response body /// - /// - Throws: An error if `self` is not `.ok`. - /// - SeeAlso: `.ok`. - public var ok: Operations.StreamGroupChatEvents.Output.Ok { + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/204`. + /// + /// HTTP response code: `204 noContent`. + public static var noContent: Self { + .noContent(.init()) + } + /// The associated value of the enum case if `self` is `.noContent`. + /// + /// - Throws: An error if `self` is not `.noContent`. + /// - SeeAlso: `.noContent`. + public var noContent: Operations.DeleteGroupFile.Output.NoContent { get throws { switch self { - case let .ok(response): + case let .noContent(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "ok", + expectedStatus: "noContent", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55265,26 +60241,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.BadRequest.Body + public var body: Operations.DeleteGroupFile.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.BadRequest.Body) { + public init(body: Operations.DeleteGroupFile.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/400`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.StreamGroupChatEvents.Output.BadRequest) + case badRequest(Operations.DeleteGroupFile.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.StreamGroupChatEvents.Output.BadRequest { + public var badRequest: Operations.DeleteGroupFile.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -55298,9 +60274,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -55316,26 +60292,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.Unauthorized.Body + public var body: Operations.DeleteGroupFile.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.Unauthorized.Body) { + public init(body: Operations.DeleteGroupFile.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/401`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.StreamGroupChatEvents.Output.Unauthorized) + case unauthorized(Operations.DeleteGroupFile.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.StreamGroupChatEvents.Output.Unauthorized { + public var unauthorized: Operations.DeleteGroupFile.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -55349,9 +60325,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55367,26 +60343,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.NotFound.Body + public var body: Operations.DeleteGroupFile.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.NotFound.Body) { + public init(body: Operations.DeleteGroupFile.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/404`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.StreamGroupChatEvents.Output.NotFound) + case notFound(Operations.DeleteGroupFile.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.StreamGroupChatEvents.Output.NotFound { + public var notFound: Operations.DeleteGroupFile.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -55400,9 +60376,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55418,26 +60394,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.MethodNotAllowed.Body + public var body: Operations.DeleteGroupFile.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.MethodNotAllowed.Body) { + public init(body: Operations.DeleteGroupFile.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/405`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.StreamGroupChatEvents.Output.MethodNotAllowed) + case methodNotAllowed(Operations.DeleteGroupFile.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.StreamGroupChatEvents.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.DeleteGroupFile.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -55451,9 +60427,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55469,26 +60445,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.Conflict.Body + public var body: Operations.DeleteGroupFile.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.Conflict.Body) { + public init(body: Operations.DeleteGroupFile.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/409`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.StreamGroupChatEvents.Output.Conflict) + case conflict(Operations.DeleteGroupFile.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.StreamGroupChatEvents.Output.Conflict { + public var conflict: Operations.DeleteGroupFile.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -55502,9 +60478,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -55520,26 +60496,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.ContentTooLarge.Body + public var body: Operations.DeleteGroupFile.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.ContentTooLarge.Body) { + public init(body: Operations.DeleteGroupFile.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/413`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.StreamGroupChatEvents.Output.ContentTooLarge) + case contentTooLarge(Operations.DeleteGroupFile.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.StreamGroupChatEvents.Output.ContentTooLarge { + public var contentTooLarge: Operations.DeleteGroupFile.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -55553,9 +60529,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55571,26 +60547,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.InternalServerError.Body + public var body: Operations.DeleteGroupFile.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.InternalServerError.Body) { + public init(body: Operations.DeleteGroupFile.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/500`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.StreamGroupChatEvents.Output.InternalServerError) + case internalServerError(Operations.DeleteGroupFile.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.StreamGroupChatEvents.Output.InternalServerError { + public var internalServerError: Operations.DeleteGroupFile.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -55604,9 +60580,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/events/GET/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/files/{fileId}/DELETE/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -55622,26 +60598,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.StreamGroupChatEvents.Output.ServiceUnavailable.Body + public var body: Operations.DeleteGroupFile.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.StreamGroupChatEvents.Output.ServiceUnavailable.Body) { + public init(body: Operations.DeleteGroupFile.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)/responses/503`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.StreamGroupChatEvents.Output.ServiceUnavailable) + case serviceUnavailable(Operations.DeleteGroupFile.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.StreamGroupChatEvents.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.DeleteGroupFile.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -55660,14 +60636,11 @@ public enum Operations { case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) } @frozen public enum AcceptableContentType: AcceptableProtocol { - case textEventStream case json case plainText case other(Swift.String) public init?(rawValue: Swift.String) { switch rawValue.lowercased() { - case "text/event-stream": - self = .textEventStream case "application/json": self = .json case "text/plain": @@ -55680,8 +60653,6 @@ public enum Operations { switch self { case let .other(string): return string - case .textEventStream: - return "text/event-stream" case .json: return "application/json" case .plainText: @@ -55690,7 +60661,6 @@ public enum Operations { } public static var allCases: [Self] { [ - .textEventStream, .json, .plainText ] @@ -56294,41 +61264,10 @@ public enum Operations { @frozen public enum Body: Sendable, Hashable { /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/AttachmentsPayload`. - public struct AttachmentsPayloadPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/AttachmentsPayload/data`. - public var data: Swift.String - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/AttachmentsPayload/mimeType`. - public var mimeType: Swift.String - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/AttachmentsPayload/name`. - public var name: Swift.String - /// Creates a new `AttachmentsPayloadPayload`. - /// - /// - Parameters: - /// - data: - /// - mimeType: - /// - name: - public init( - data: Swift.String, - mimeType: Swift.String, - name: Swift.String - ) { - self.data = data - self.mimeType = mimeType - self.name = name - } - public enum CodingKeys: String, CodingKey { - case data - case mimeType - case name - } - } - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/attachments`. - public typealias AttachmentsPayload = [Operations.SendGroupMessage.Input.Body.JsonPayload.AttachmentsPayloadPayload] - /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/attachments`. - public var attachments: Operations.SendGroupMessage.Input.Body.JsonPayload.AttachmentsPayload? /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/content`. public var content: Swift.String + /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/files`. + public var files: [Swift.String]? /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/replyTo`. public var replyTo: Swift.String? /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/json/requestId`. @@ -56336,27 +61275,52 @@ public enum Operations { /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - attachments: /// - content: + /// - files: /// - replyTo: /// - requestId: public init( - attachments: Operations.SendGroupMessage.Input.Body.JsonPayload.AttachmentsPayload? = nil, content: Swift.String, + files: [Swift.String]? = nil, replyTo: Swift.String? = nil, requestId: Swift.String ) { - self.attachments = attachments self.content = content + self.files = files self.replyTo = replyTo self.requestId = requestId } public enum CodingKeys: String, CodingKey { - case attachments case content + case files case replyTo case requestId } + public init(from decoder: any Swift.Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + self.content = try container.decode( + Swift.String.self, + forKey: .content + ) + self.files = try container.decodeIfPresent( + [Swift.String].self, + forKey: .files + ) + self.replyTo = try container.decodeIfPresent( + Swift.String.self, + forKey: .replyTo + ) + self.requestId = try container.decode( + Swift.String.self, + forKey: .requestId + ) + try decoder.ensureNoAdditionalProperties(knownKeys: [ + "content", + "files", + "replyTo", + "requestId" + ]) + } } /// - Remark: Generated from `#/paths/v1/group-chats/{id}/messages/POST/requestBody/content/application\/json`. case json(Operations.SendGroupMessage.Input.Body.JsonPayload) @@ -76110,121 +81074,137 @@ public enum Operations { } } } - /// - Remark: HTTP `PUT /v1/push/devices/{installationId}/presence`. - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)`. - public enum PutPushPresence { - public static let id: Swift.String = "putPushPresence" + /// - Remark: HTTP `POST /v1/reasoning/preview`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)`. + public enum PreviewReasoning { + public static let id: Swift.String = "previewReasoning" public struct Input: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/path`. - public struct Path: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/path/installationId`. - public var installationId: Swift.String - /// Creates a new `Path`. - /// - /// - Parameters: - /// - installationId: - public init(installationId: Swift.String) { - self.installationId = installationId - } - } - public var path: Operations.PutPushPresence.Input.Path - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/header`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/header`. public struct Headers: Sendable, Hashable { - public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] /// Creates a new `Headers`. /// /// - Parameters: /// - accept: - public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { self.accept = accept } } - public var headers: Operations.PutPushPresence.Input.Headers - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/requestBody`. + public var headers: Operations.PreviewReasoning.Input.Headers + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/requestBody/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody/json`. public struct JsonPayload: Codable, Hashable, Sendable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/requestBody/json/active`. - public var active: Swift.Bool - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/requestBody/json/agentId`. - public var agentId: Swift.String? + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody/json/model`. + public var model: Swift.String + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody/json/provider`. + public var provider: Swift.String + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody/json/thinkingLevel`. + @frozen public enum ThinkingLevelPayload: String, Codable, Hashable, Sendable, CaseIterable { + case off = "off" + case minimal = "minimal" + case low = "low" + case medium = "medium" + case high = "high" + case xhigh = "xhigh" + case max = "max" + } + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody/json/thinkingLevel`. + public var thinkingLevel: Operations.PreviewReasoning.Input.Body.JsonPayload.ThinkingLevelPayload? /// Creates a new `JsonPayload`. /// /// - Parameters: - /// - active: - /// - agentId: + /// - model: + /// - provider: + /// - thinkingLevel: public init( - active: Swift.Bool, - agentId: Swift.String? = nil + model: Swift.String, + provider: Swift.String, + thinkingLevel: Operations.PreviewReasoning.Input.Body.JsonPayload.ThinkingLevelPayload? = nil ) { - self.active = active - self.agentId = agentId + self.model = model + self.provider = provider + self.thinkingLevel = thinkingLevel } public enum CodingKeys: String, CodingKey { - case active - case agentId + case model + case provider + case thinkingLevel } } - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/requestBody/content/application\/json`. - case json(Operations.PutPushPresence.Input.Body.JsonPayload) + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/requestBody/content/application\/json`. + case json(Operations.PreviewReasoning.Input.Body.JsonPayload) } - public var body: Operations.PutPushPresence.Input.Body + public var body: Operations.PreviewReasoning.Input.Body /// Creates a new `Input`. /// /// - Parameters: - /// - path: /// - headers: /// - body: public init( - path: Operations.PutPushPresence.Input.Path, - headers: Operations.PutPushPresence.Input.Headers = .init(), - body: Operations.PutPushPresence.Input.Body + headers: Operations.PreviewReasoning.Input.Headers = .init(), + body: Operations.PreviewReasoning.Input.Body ) { - self.path = path self.headers = headers self.body = body } } @frozen public enum Output: Sendable, Hashable { - public struct NoContent: Sendable, Hashable { - /// Creates a new `NoContent`. - public init() {} + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/200/content/application\/json`. + case json(Components.Schemas.ReasoningPreview) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.ReasoningPreview { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewReasoning.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewReasoning.Output.Ok.Body) { + self.body = body + } } - /// Success, no response body - /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/204`. - /// - /// HTTP response code: `204 noContent`. - case noContent(Operations.PutPushPresence.Output.NoContent) - /// Success, no response body + /// Success /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/204`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/200`. /// - /// HTTP response code: `204 noContent`. - public static var noContent: Self { - .noContent(.init()) - } - /// The associated value of the enum case if `self` is `.noContent`. + /// HTTP response code: `200 ok`. + case ok(Operations.PreviewReasoning.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. /// - /// - Throws: An error if `self` is not `.noContent`. - /// - SeeAlso: `.noContent`. - public var noContent: Operations.PutPushPresence.Output.NoContent { + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.PreviewReasoning.Output.Ok { get throws { switch self { - case let .noContent(response): + case let .ok(response): return response default: try throwUnexpectedResponseStatus( - expectedStatus: "noContent", + expectedStatus: "ok", response: self ) } } } public struct BadRequest: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/400/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/400/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/400/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/400/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -76240,26 +81220,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.BadRequest.Body + public var body: Operations.PreviewReasoning.Output.BadRequest.Body /// Creates a new `BadRequest`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.BadRequest.Body) { + public init(body: Operations.PreviewReasoning.Output.BadRequest.Body) { self.body = body } } /// Invalid request or operation /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/400`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/400`. /// /// HTTP response code: `400 badRequest`. - case badRequest(Operations.PutPushPresence.Output.BadRequest) + case badRequest(Operations.PreviewReasoning.Output.BadRequest) /// The associated value of the enum case if `self` is `.badRequest`. /// /// - Throws: An error if `self` is not `.badRequest`. /// - SeeAlso: `.badRequest`. - public var badRequest: Operations.PutPushPresence.Output.BadRequest { + public var badRequest: Operations.PreviewReasoning.Output.BadRequest { get throws { switch self { case let .badRequest(response): @@ -76273,9 +81253,9 @@ public enum Operations { } } public struct Unauthorized: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/401/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/401/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/401/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/401/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -76291,26 +81271,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.Unauthorized.Body + public var body: Operations.PreviewReasoning.Output.Unauthorized.Body /// Creates a new `Unauthorized`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.Unauthorized.Body) { + public init(body: Operations.PreviewReasoning.Output.Unauthorized.Body) { self.body = body } } /// Missing, expired, or invalid account session /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/401`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/401`. /// /// HTTP response code: `401 unauthorized`. - case unauthorized(Operations.PutPushPresence.Output.Unauthorized) + case unauthorized(Operations.PreviewReasoning.Output.Unauthorized) /// The associated value of the enum case if `self` is `.unauthorized`. /// /// - Throws: An error if `self` is not `.unauthorized`. /// - SeeAlso: `.unauthorized`. - public var unauthorized: Operations.PutPushPresence.Output.Unauthorized { + public var unauthorized: Operations.PreviewReasoning.Output.Unauthorized { get throws { switch self { case let .unauthorized(response): @@ -76324,9 +81304,9 @@ public enum Operations { } } public struct NotFound: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/404/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/404/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/404/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/404/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -76342,26 +81322,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.NotFound.Body + public var body: Operations.PreviewReasoning.Output.NotFound.Body /// Creates a new `NotFound`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.NotFound.Body) { + public init(body: Operations.PreviewReasoning.Output.NotFound.Body) { self.body = body } } /// Resource not found /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/404`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/404`. /// /// HTTP response code: `404 notFound`. - case notFound(Operations.PutPushPresence.Output.NotFound) + case notFound(Operations.PreviewReasoning.Output.NotFound) /// The associated value of the enum case if `self` is `.notFound`. /// /// - Throws: An error if `self` is not `.notFound`. /// - SeeAlso: `.notFound`. - public var notFound: Operations.PutPushPresence.Output.NotFound { + public var notFound: Operations.PreviewReasoning.Output.NotFound { get throws { switch self { case let .notFound(response): @@ -76375,9 +81355,9 @@ public enum Operations { } } public struct MethodNotAllowed: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/405/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/405/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/405/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/405/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -76393,26 +81373,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.MethodNotAllowed.Body + public var body: Operations.PreviewReasoning.Output.MethodNotAllowed.Body /// Creates a new `MethodNotAllowed`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.MethodNotAllowed.Body) { + public init(body: Operations.PreviewReasoning.Output.MethodNotAllowed.Body) { self.body = body } } /// Resource is read-only /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/405`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/405`. /// /// HTTP response code: `405 methodNotAllowed`. - case methodNotAllowed(Operations.PutPushPresence.Output.MethodNotAllowed) + case methodNotAllowed(Operations.PreviewReasoning.Output.MethodNotAllowed) /// The associated value of the enum case if `self` is `.methodNotAllowed`. /// /// - Throws: An error if `self` is not `.methodNotAllowed`. /// - SeeAlso: `.methodNotAllowed`. - public var methodNotAllowed: Operations.PutPushPresence.Output.MethodNotAllowed { + public var methodNotAllowed: Operations.PreviewReasoning.Output.MethodNotAllowed { get throws { switch self { case let .methodNotAllowed(response): @@ -76426,9 +81406,9 @@ public enum Operations { } } public struct Conflict: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/409/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/409/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/409/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/409/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -76444,26 +81424,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.Conflict.Body + public var body: Operations.PreviewReasoning.Output.Conflict.Body /// Creates a new `Conflict`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.Conflict.Body) { + public init(body: Operations.PreviewReasoning.Output.Conflict.Body) { self.body = body } } /// Conflicting request /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/409`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/409`. /// /// HTTP response code: `409 conflict`. - case conflict(Operations.PutPushPresence.Output.Conflict) + case conflict(Operations.PreviewReasoning.Output.Conflict) /// The associated value of the enum case if `self` is `.conflict`. /// /// - Throws: An error if `self` is not `.conflict`. /// - SeeAlso: `.conflict`. - public var conflict: Operations.PutPushPresence.Output.Conflict { + public var conflict: Operations.PreviewReasoning.Output.Conflict { get throws { switch self { case let .conflict(response): @@ -76477,9 +81457,9 @@ public enum Operations { } } public struct ContentTooLarge: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/413/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/413/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/413/content/text\/plain`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/413/content/text\/plain`. case plainText(OpenAPIRuntime.HTTPBody) /// The associated value of the enum case if `self` is `.plainText`. /// @@ -76495,26 +81475,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.ContentTooLarge.Body + public var body: Operations.PreviewReasoning.Output.ContentTooLarge.Body /// Creates a new `ContentTooLarge`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.ContentTooLarge.Body) { + public init(body: Operations.PreviewReasoning.Output.ContentTooLarge.Body) { self.body = body } } /// Request body exceeds the size limit /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/413`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/413`. /// /// HTTP response code: `413 contentTooLarge`. - case contentTooLarge(Operations.PutPushPresence.Output.ContentTooLarge) + case contentTooLarge(Operations.PreviewReasoning.Output.ContentTooLarge) /// The associated value of the enum case if `self` is `.contentTooLarge`. /// /// - Throws: An error if `self` is not `.contentTooLarge`. /// - SeeAlso: `.contentTooLarge`. - public var contentTooLarge: Operations.PutPushPresence.Output.ContentTooLarge { + public var contentTooLarge: Operations.PreviewReasoning.Output.ContentTooLarge { get throws { switch self { case let .contentTooLarge(response): @@ -76528,9 +81508,9 @@ public enum Operations { } } public struct InternalServerError: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/500/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/500/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/500/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/500/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -76546,26 +81526,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.InternalServerError.Body + public var body: Operations.PreviewReasoning.Output.InternalServerError.Body /// Creates a new `InternalServerError`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.InternalServerError.Body) { + public init(body: Operations.PreviewReasoning.Output.InternalServerError.Body) { self.body = body } } /// Internal server error /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/500`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/500`. /// /// HTTP response code: `500 internalServerError`. - case internalServerError(Operations.PutPushPresence.Output.InternalServerError) + case internalServerError(Operations.PreviewReasoning.Output.InternalServerError) /// The associated value of the enum case if `self` is `.internalServerError`. /// /// - Throws: An error if `self` is not `.internalServerError`. /// - SeeAlso: `.internalServerError`. - public var internalServerError: Operations.PutPushPresence.Output.InternalServerError { + public var internalServerError: Operations.PreviewReasoning.Output.InternalServerError { get throws { switch self { case let .internalServerError(response): @@ -76579,9 +81559,9 @@ public enum Operations { } } public struct ServiceUnavailable: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/503/content`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/503/content`. @frozen public enum Body: Sendable, Hashable { - /// - Remark: Generated from `#/paths/v1/push/devices/{installationId}/presence/PUT/responses/503/content/application\/json`. + /// - Remark: Generated from `#/paths/v1/reasoning/preview/POST/responses/503/content/application\/json`. case json(Components.Schemas._Error) /// The associated value of the enum case if `self` is `.json`. /// @@ -76597,26 +81577,26 @@ public enum Operations { } } /// Received HTTP response body - public var body: Operations.PutPushPresence.Output.ServiceUnavailable.Body + public var body: Operations.PreviewReasoning.Output.ServiceUnavailable.Body /// Creates a new `ServiceUnavailable`. /// /// - Parameters: /// - body: Received HTTP response body - public init(body: Operations.PutPushPresence.Output.ServiceUnavailable.Body) { + public init(body: Operations.PreviewReasoning.Output.ServiceUnavailable.Body) { self.body = body } } /// Service unavailable /// - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)/responses/503`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)/responses/503`. /// /// HTTP response code: `503 serviceUnavailable`. - case serviceUnavailable(Operations.PutPushPresence.Output.ServiceUnavailable) + case serviceUnavailable(Operations.PreviewReasoning.Output.ServiceUnavailable) /// The associated value of the enum case if `self` is `.serviceUnavailable`. /// /// - Throws: An error if `self` is not `.serviceUnavailable`. /// - SeeAlso: `.serviceUnavailable`. - public var serviceUnavailable: Operations.PutPushPresence.Output.ServiceUnavailable { + public var serviceUnavailable: Operations.PreviewReasoning.Output.ServiceUnavailable { get throws { switch self { case let .serviceUnavailable(response): @@ -77878,6 +82858,574 @@ public enum Operations { } } } + /// - Remark: HTTP `POST /v1/schedules/preview`. + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)`. + public enum PreviewSchedule { + public static let id: Swift.String = "previewSchedule" + public struct Input: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/header`. + public struct Headers: Sendable, Hashable { + public var accept: [OpenAPIRuntime.AcceptHeaderContentType] + /// Creates a new `Headers`. + /// + /// - Parameters: + /// - accept: + public init(accept: [OpenAPIRuntime.AcceptHeaderContentType] = .defaultValues()) { + self.accept = accept + } + } + public var headers: Operations.PreviewSchedule.Input.Headers + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody/json`. + public struct JsonPayload: Codable, Hashable, Sendable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody/json/cron`. + public var cron: Swift.String? + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody/json/eventSourceId`. + public var eventSourceId: Swift.String? + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody/json/runAt`. + public var runAt: Foundation.Date? + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody/json/timezone`. + public var timezone: Swift.String + /// Creates a new `JsonPayload`. + /// + /// - Parameters: + /// - cron: + /// - eventSourceId: + /// - runAt: + /// - timezone: + public init( + cron: Swift.String? = nil, + eventSourceId: Swift.String? = nil, + runAt: Foundation.Date? = nil, + timezone: Swift.String + ) { + self.cron = cron + self.eventSourceId = eventSourceId + self.runAt = runAt + self.timezone = timezone + } + public enum CodingKeys: String, CodingKey { + case cron + case eventSourceId + case runAt + case timezone + } + } + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/requestBody/content/application\/json`. + case json(Operations.PreviewSchedule.Input.Body.JsonPayload) + } + public var body: Operations.PreviewSchedule.Input.Body + /// Creates a new `Input`. + /// + /// - Parameters: + /// - headers: + /// - body: + public init( + headers: Operations.PreviewSchedule.Input.Headers = .init(), + body: Operations.PreviewSchedule.Input.Body + ) { + self.headers = headers + self.body = body + } + } + @frozen public enum Output: Sendable, Hashable { + public struct Ok: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/200/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/200/content/application\/json`. + case json(Components.Schemas.SchedulePreview) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas.SchedulePreview { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.Ok.Body + /// Creates a new `Ok`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.Ok.Body) { + self.body = body + } + } + /// Success + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/200`. + /// + /// HTTP response code: `200 ok`. + case ok(Operations.PreviewSchedule.Output.Ok) + /// The associated value of the enum case if `self` is `.ok`. + /// + /// - Throws: An error if `self` is not `.ok`. + /// - SeeAlso: `.ok`. + public var ok: Operations.PreviewSchedule.Output.Ok { + get throws { + switch self { + case let .ok(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "ok", + response: self + ) + } + } + } + public struct BadRequest: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/400/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/400/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.BadRequest.Body + /// Creates a new `BadRequest`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.BadRequest.Body) { + self.body = body + } + } + /// Invalid request or operation + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/400`. + /// + /// HTTP response code: `400 badRequest`. + case badRequest(Operations.PreviewSchedule.Output.BadRequest) + /// The associated value of the enum case if `self` is `.badRequest`. + /// + /// - Throws: An error if `self` is not `.badRequest`. + /// - SeeAlso: `.badRequest`. + public var badRequest: Operations.PreviewSchedule.Output.BadRequest { + get throws { + switch self { + case let .badRequest(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "badRequest", + response: self + ) + } + } + } + public struct Unauthorized: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/401/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/401/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.Unauthorized.Body + /// Creates a new `Unauthorized`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.Unauthorized.Body) { + self.body = body + } + } + /// Missing, expired, or invalid account session + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/401`. + /// + /// HTTP response code: `401 unauthorized`. + case unauthorized(Operations.PreviewSchedule.Output.Unauthorized) + /// The associated value of the enum case if `self` is `.unauthorized`. + /// + /// - Throws: An error if `self` is not `.unauthorized`. + /// - SeeAlso: `.unauthorized`. + public var unauthorized: Operations.PreviewSchedule.Output.Unauthorized { + get throws { + switch self { + case let .unauthorized(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "unauthorized", + response: self + ) + } + } + } + public struct NotFound: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/404/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/404/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.NotFound.Body + /// Creates a new `NotFound`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.NotFound.Body) { + self.body = body + } + } + /// Resource not found + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/404`. + /// + /// HTTP response code: `404 notFound`. + case notFound(Operations.PreviewSchedule.Output.NotFound) + /// The associated value of the enum case if `self` is `.notFound`. + /// + /// - Throws: An error if `self` is not `.notFound`. + /// - SeeAlso: `.notFound`. + public var notFound: Operations.PreviewSchedule.Output.NotFound { + get throws { + switch self { + case let .notFound(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "notFound", + response: self + ) + } + } + } + public struct MethodNotAllowed: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/405/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/405/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.MethodNotAllowed.Body + /// Creates a new `MethodNotAllowed`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.MethodNotAllowed.Body) { + self.body = body + } + } + /// Resource is read-only + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/405`. + /// + /// HTTP response code: `405 methodNotAllowed`. + case methodNotAllowed(Operations.PreviewSchedule.Output.MethodNotAllowed) + /// The associated value of the enum case if `self` is `.methodNotAllowed`. + /// + /// - Throws: An error if `self` is not `.methodNotAllowed`. + /// - SeeAlso: `.methodNotAllowed`. + public var methodNotAllowed: Operations.PreviewSchedule.Output.MethodNotAllowed { + get throws { + switch self { + case let .methodNotAllowed(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "methodNotAllowed", + response: self + ) + } + } + } + public struct Conflict: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/409/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/409/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.Conflict.Body + /// Creates a new `Conflict`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.Conflict.Body) { + self.body = body + } + } + /// Conflicting request + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/409`. + /// + /// HTTP response code: `409 conflict`. + case conflict(Operations.PreviewSchedule.Output.Conflict) + /// The associated value of the enum case if `self` is `.conflict`. + /// + /// - Throws: An error if `self` is not `.conflict`. + /// - SeeAlso: `.conflict`. + public var conflict: Operations.PreviewSchedule.Output.Conflict { + get throws { + switch self { + case let .conflict(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "conflict", + response: self + ) + } + } + } + public struct ContentTooLarge: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/413/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/413/content/text\/plain`. + case plainText(OpenAPIRuntime.HTTPBody) + /// The associated value of the enum case if `self` is `.plainText`. + /// + /// - Throws: An error if `self` is not `.plainText`. + /// - SeeAlso: `.plainText`. + public var plainText: OpenAPIRuntime.HTTPBody { + get throws { + switch self { + case let .plainText(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.ContentTooLarge.Body + /// Creates a new `ContentTooLarge`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.ContentTooLarge.Body) { + self.body = body + } + } + /// Request body exceeds the size limit + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/413`. + /// + /// HTTP response code: `413 contentTooLarge`. + case contentTooLarge(Operations.PreviewSchedule.Output.ContentTooLarge) + /// The associated value of the enum case if `self` is `.contentTooLarge`. + /// + /// - Throws: An error if `self` is not `.contentTooLarge`. + /// - SeeAlso: `.contentTooLarge`. + public var contentTooLarge: Operations.PreviewSchedule.Output.ContentTooLarge { + get throws { + switch self { + case let .contentTooLarge(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "contentTooLarge", + response: self + ) + } + } + } + public struct InternalServerError: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/500/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/500/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.InternalServerError.Body + /// Creates a new `InternalServerError`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.InternalServerError.Body) { + self.body = body + } + } + /// Internal server error + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/500`. + /// + /// HTTP response code: `500 internalServerError`. + case internalServerError(Operations.PreviewSchedule.Output.InternalServerError) + /// The associated value of the enum case if `self` is `.internalServerError`. + /// + /// - Throws: An error if `self` is not `.internalServerError`. + /// - SeeAlso: `.internalServerError`. + public var internalServerError: Operations.PreviewSchedule.Output.InternalServerError { + get throws { + switch self { + case let .internalServerError(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "internalServerError", + response: self + ) + } + } + } + public struct ServiceUnavailable: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/503/content`. + @frozen public enum Body: Sendable, Hashable { + /// - Remark: Generated from `#/paths/v1/schedules/preview/POST/responses/503/content/application\/json`. + case json(Components.Schemas._Error) + /// The associated value of the enum case if `self` is `.json`. + /// + /// - Throws: An error if `self` is not `.json`. + /// - SeeAlso: `.json`. + public var json: Components.Schemas._Error { + get throws { + switch self { + case let .json(body): + return body + } + } + } + } + /// Received HTTP response body + public var body: Operations.PreviewSchedule.Output.ServiceUnavailable.Body + /// Creates a new `ServiceUnavailable`. + /// + /// - Parameters: + /// - body: Received HTTP response body + public init(body: Operations.PreviewSchedule.Output.ServiceUnavailable.Body) { + self.body = body + } + } + /// Service unavailable + /// + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)/responses/503`. + /// + /// HTTP response code: `503 serviceUnavailable`. + case serviceUnavailable(Operations.PreviewSchedule.Output.ServiceUnavailable) + /// The associated value of the enum case if `self` is `.serviceUnavailable`. + /// + /// - Throws: An error if `self` is not `.serviceUnavailable`. + /// - SeeAlso: `.serviceUnavailable`. + public var serviceUnavailable: Operations.PreviewSchedule.Output.ServiceUnavailable { + get throws { + switch self { + case let .serviceUnavailable(response): + return response + default: + try throwUnexpectedResponseStatus( + expectedStatus: "serviceUnavailable", + response: self + ) + } + } + } + /// Undocumented response. + /// + /// A response with a code that is not documented in the OpenAPI document. + case undocumented(statusCode: Swift.Int, OpenAPIRuntime.UndocumentedPayload) + } + @frozen public enum AcceptableContentType: AcceptableProtocol { + case json + case plainText + case other(Swift.String) + public init?(rawValue: Swift.String) { + switch rawValue.lowercased() { + case "application/json": + self = .json + case "text/plain": + self = .plainText + default: + self = .other(rawValue) + } + } + public var rawValue: Swift.String { + switch self { + case let .other(string): + return string + case .json: + return "application/json" + case .plainText: + return "text/plain" + } + } + public static var allCases: [Self] { + [ + .json, + .plainText + ] + } + } + } /// - Remark: HTTP `PATCH /v1/schedules/{id}`. /// - Remark: Generated from `#/paths//v1/schedules/{id}/patch(updateSchedule)`. public enum UpdateSchedule { @@ -78034,6 +83582,8 @@ public enum Operations { public var createdByAgentId: Swift.String? /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/cron`. public var cron: Swift.String? + /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/description`. + public var description: Swift.String /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/enabled`. public var enabled: Swift.Bool /// The event source whose events start this automation; set instead of `cron` and `runAt`. @@ -78053,6 +83603,8 @@ public enum Operations { public var name: Swift.String /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/nextRunAt`. public var nextRunAt: Swift.String? + /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/nextRunLabel`. + public var nextRunLabel: Swift.String /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/notify`. public var notify: Swift.Bool /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/prompt`. @@ -78063,6 +83615,8 @@ public enum Operations { public var timeoutSeconds: Swift.Int /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/timezone`. public var timezone: Swift.String + /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/json/timing`. + public var timing: Swift.String /// Creates a new `JsonPayload`. /// /// - Parameters: @@ -78071,51 +83625,60 @@ public enum Operations { /// - createdAt: /// - createdByAgentId: /// - cron: + /// - description: /// - enabled: /// - eventSourceId: The event source whose events start this automation; set instead of `cron` and `runAt`. /// - id: /// - kind: /// - name: /// - nextRunAt: + /// - nextRunLabel: /// - notify: /// - prompt: /// - runAt: /// - timeoutSeconds: /// - timezone: + /// - timing: public init( agentId: Swift.String, command: Swift.String? = nil, createdAt: Swift.String, createdByAgentId: Swift.String? = nil, cron: Swift.String? = nil, + description: Swift.String, enabled: Swift.Bool, eventSourceId: Swift.String? = nil, id: Swift.String, kind: Operations.UpdateSchedule.Output.Ok.Body.JsonPayload.KindPayload, name: Swift.String, nextRunAt: Swift.String? = nil, + nextRunLabel: Swift.String, notify: Swift.Bool, prompt: Swift.String, runAt: Swift.String? = nil, timeoutSeconds: Swift.Int, - timezone: Swift.String + timezone: Swift.String, + timing: Swift.String ) { self.agentId = agentId self.command = command self.createdAt = createdAt self.createdByAgentId = createdByAgentId self.cron = cron + self.description = description self.enabled = enabled self.eventSourceId = eventSourceId self.id = id self.kind = kind self.name = name self.nextRunAt = nextRunAt + self.nextRunLabel = nextRunLabel self.notify = notify self.prompt = prompt self.runAt = runAt self.timeoutSeconds = timeoutSeconds self.timezone = timezone + self.timing = timing } public enum CodingKeys: String, CodingKey { case agentId @@ -78123,17 +83686,20 @@ public enum Operations { case createdAt case createdByAgentId case cron + case description case enabled case eventSourceId case id case kind case name case nextRunAt + case nextRunLabel case notify case prompt case runAt case timeoutSeconds case timezone + case timing } } /// - Remark: Generated from `#/paths/v1/schedules/{id}/PATCH/responses/200/content/application\/json`. @@ -87662,7 +93228,7 @@ public enum Operations { public var callsOthers: Swift.Bool /// - Remark: Generated from `#/paths/v1/voice-gateway/GET/responses/200/content/json/config/LinesPayload/callsOwner`. public var callsOwner: Swift.Bool - /// The name callers hear; null uses the bot's name. + /// The caller name sent to the telephone system; null uses the bot's name. /// /// - Remark: Generated from `#/paths/v1/voice-gateway/GET/responses/200/content/json/config/LinesPayload/displayName`. public var displayName: Swift.String? @@ -87674,7 +93240,7 @@ public enum Operations { /// - botId: /// - callsOthers: Whether the line's bot may ask to call people other than the owner, each call after the owner approved it. Absent means false. /// - callsOwner: - /// - displayName: The name callers hear; null uses the bot's name. + /// - displayName: The caller name sent to the telephone system; null uses the bot's name. /// - username: public init( botId: Swift.String, @@ -88440,7 +94006,7 @@ public enum Operations { public var callsOthers: Swift.Bool /// - Remark: Generated from `#/paths/v1/voice-gateway/PUT/requestBody/json/LinesPayload/callsOwner`. public var callsOwner: Swift.Bool - /// The name callers hear; null uses the bot's name. + /// The caller name sent to the telephone system; null uses the bot's name. /// /// - Remark: Generated from `#/paths/v1/voice-gateway/PUT/requestBody/json/LinesPayload/displayName`. public var displayName: Swift.String? @@ -88452,7 +94018,7 @@ public enum Operations { /// - botId: /// - callsOthers: Whether the line's bot may ask to call people other than the owner, each call after the owner approved it. Absent means false. /// - callsOwner: - /// - displayName: The name callers hear; null uses the bot's name. + /// - displayName: The caller name sent to the telephone system; null uses the bot's name. /// - username: public init( botId: Swift.String, @@ -88591,7 +94157,7 @@ public enum Operations { public var callsOthers: Swift.Bool /// - Remark: Generated from `#/paths/v1/voice-gateway/PUT/responses/200/content/json/config/LinesPayload/callsOwner`. public var callsOwner: Swift.Bool - /// The name callers hear; null uses the bot's name. + /// The caller name sent to the telephone system; null uses the bot's name. /// /// - Remark: Generated from `#/paths/v1/voice-gateway/PUT/responses/200/content/json/config/LinesPayload/displayName`. public var displayName: Swift.String? @@ -88603,7 +94169,7 @@ public enum Operations { /// - botId: /// - callsOthers: Whether the line's bot may ask to call people other than the owner, each call after the owner approved it. Absent means false. /// - callsOwner: - /// - displayName: The name callers hear; null uses the bot's name. + /// - displayName: The caller name sent to the telephone system; null uses the bot's name. /// - username: public init( botId: Swift.String, diff --git a/apfelkern/Sources/apfelkern/Generated/Types.swift b/apfelkern/Sources/apfelkern/Generated/Types.swift index a018493..5cdfe7c 100644 --- a/apfelkern/Sources/apfelkern/Generated/Types.swift +++ b/apfelkern/Sources/apfelkern/Generated/Types.swift @@ -199,6 +199,18 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /v1/agents/{id}/events`. /// - Remark: Generated from `#/paths//v1/agents/{id}/events/get(streamChatEvents)`. func streamChatEvents(_ input: Operations.StreamChatEvents.Input) async throws -> Operations.StreamChatEvents.Output + /// - Remark: HTTP `GET /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)`. + func listFiles(_ input: Operations.ListFiles.Input) async throws -> Operations.ListFiles.Output + /// - Remark: HTTP `POST /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)`. + func uploadFile(_ input: Operations.UploadFile.Input) async throws -> Operations.UploadFile.Output + /// - Remark: HTTP `GET /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)`. + func getFile(_ input: Operations.GetFile.Input) async throws -> Operations.GetFile.Output + /// - Remark: HTTP `DELETE /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)`. + func deleteFile(_ input: Operations.DeleteFile.Input) async throws -> Operations.DeleteFile.Output /// Desktop job actions an intent check held for the owner, newest first, pending and decided. /// /// - Remark: HTTP `GET /v1/agents/{id}/held-actions`. @@ -288,6 +300,12 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `POST /v1/changes/{id}/revert`. /// - Remark: Generated from `#/paths//v1/changes/{id}/revert/post(revertChange)`. func revertChange(_ input: Operations.RevertChange.Input) async throws -> Operations.RevertChange.Output + /// - Remark: HTTP `POST /v1/chat-attention/seen`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)`. + func postChatAttentionSeen(_ input: Operations.PostChatAttentionSeen.Input) async throws -> Operations.PostChatAttentionSeen.Output + /// - Remark: HTTP `PUT /v1/chat-attention/views/{viewId}`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)`. + func putChatAttentionView(_ input: Operations.PutChatAttentionView.Input) async throws -> Operations.PutChatAttentionView.Output /// The account's event relay: its URL, whether the Doorstep account token is set (plugin setting `doorstep:token`), and the connection status. /// /// - Remark: HTTP `GET /v1/event-relay`. @@ -411,9 +429,6 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /v1/group-chats/{id}`. /// - Remark: Generated from `#/paths//v1/group-chats/{id}/delete(deleteGroupChat)`. func deleteGroupChat(_ input: Operations.DeleteGroupChat.Input) async throws -> Operations.DeleteGroupChat.Output - /// - Remark: HTTP `GET /v1/group-chats/{id}/attachments/{entryId}/{index}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)`. - func getGroupAttachment(_ input: Operations.GetGroupAttachment.Input) async throws -> Operations.GetGroupAttachment.Output /// - Remark: HTTP `GET /v1/group-chats/{id}/chat`. /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)`. func getGroupChatSnapshot(_ input: Operations.GetGroupChatSnapshot.Input) async throws -> Operations.GetGroupChatSnapshot.Output @@ -422,6 +437,18 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `GET /v1/group-chats/{id}/events`. /// - Remark: Generated from `#/paths//v1/group-chats/{id}/events/get(streamGroupChatEvents)`. func streamGroupChatEvents(_ input: Operations.StreamGroupChatEvents.Input) async throws -> Operations.StreamGroupChatEvents.Output + /// - Remark: HTTP `GET /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)`. + func listGroupFiles(_ input: Operations.ListGroupFiles.Input) async throws -> Operations.ListGroupFiles.Output + /// - Remark: HTTP `POST /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)`. + func uploadGroupFile(_ input: Operations.UploadGroupFile.Input) async throws -> Operations.UploadGroupFile.Output + /// - Remark: HTTP `GET /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)`. + func getGroupFile(_ input: Operations.GetGroupFile.Input) async throws -> Operations.GetGroupFile.Output + /// - Remark: HTTP `DELETE /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)`. + func deleteGroupFile(_ input: Operations.DeleteGroupFile.Input) async throws -> Operations.DeleteGroupFile.Output /// - Remark: HTTP `GET /v1/group-chats/{id}/history`. /// - Remark: Generated from `#/paths//v1/group-chats/{id}/history/get(getGroupChatHistory)`. func getGroupChatHistory(_ input: Operations.GetGroupChatHistory.Input) async throws -> Operations.GetGroupChatHistory.Output @@ -547,15 +574,18 @@ public protocol APIProtocol: Sendable { /// - Remark: HTTP `DELETE /v1/push/devices/{installationId}`. /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/delete(deletePushDevice)`. func deletePushDevice(_ input: Operations.DeletePushDevice.Input) async throws -> Operations.DeletePushDevice.Output - /// - Remark: HTTP `PUT /v1/push/devices/{installationId}/presence`. - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)`. - func putPushPresence(_ input: Operations.PutPushPresence.Input) async throws -> Operations.PutPushPresence.Output + /// - Remark: HTTP `POST /v1/reasoning/preview`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)`. + func previewReasoning(_ input: Operations.PreviewReasoning.Input) async throws -> Operations.PreviewReasoning.Output /// - Remark: HTTP `GET /v1/schedules`. /// - Remark: Generated from `#/paths//v1/schedules/get(listSchedules)`. func listSchedules(_ input: Operations.ListSchedules.Input) async throws -> Operations.ListSchedules.Output /// - Remark: HTTP `POST /v1/schedules`. /// - Remark: Generated from `#/paths//v1/schedules/post(createSchedule)`. func createSchedule(_ input: Operations.CreateSchedule.Input) async throws -> Operations.CreateSchedule.Output + /// - Remark: HTTP `POST /v1/schedules/preview`. + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)`. + func previewSchedule(_ input: Operations.PreviewSchedule.Input) async throws -> Operations.PreviewSchedule.Output /// - Remark: HTTP `PATCH /v1/schedules/{id}`. /// - Remark: Generated from `#/paths//v1/schedules/{id}/patch(updateSchedule)`. func updateSchedule(_ input: Operations.UpdateSchedule.Input) async throws -> Operations.UpdateSchedule.Output @@ -1234,6 +1264,54 @@ extension APIProtocol { headers: headers )) } + /// - Remark: HTTP `GET /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/get(listFiles)`. + public func listFiles( + path: Operations.ListFiles.Input.Path, + query: Operations.ListFiles.Input.Query = .init(), + headers: Operations.ListFiles.Input.Headers = .init() + ) async throws -> Operations.ListFiles.Output { + try await listFiles(Operations.ListFiles.Input( + path: path, + query: query, + headers: headers + )) + } + /// - Remark: HTTP `POST /v1/agents/{id}/files`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/post(uploadFile)`. + public func uploadFile( + path: Operations.UploadFile.Input.Path, + headers: Operations.UploadFile.Input.Headers, + body: Operations.UploadFile.Input.Body + ) async throws -> Operations.UploadFile.Output { + try await uploadFile(Operations.UploadFile.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `GET /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/get(getFile)`. + public func getFile( + path: Operations.GetFile.Input.Path, + headers: Operations.GetFile.Input.Headers = .init() + ) async throws -> Operations.GetFile.Output { + try await getFile(Operations.GetFile.Input( + path: path, + headers: headers + )) + } + /// - Remark: HTTP `DELETE /v1/agents/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/agents/{id}/files/{fileId}/delete(deleteFile)`. + public func deleteFile( + path: Operations.DeleteFile.Input.Path, + headers: Operations.DeleteFile.Input.Headers = .init() + ) async throws -> Operations.DeleteFile.Output { + try await deleteFile(Operations.DeleteFile.Input( + path: path, + headers: headers + )) + } /// Desktop job actions an intent check held for the owner, newest first, pending and decided. /// /// - Remark: HTTP `GET /v1/agents/{id}/held-actions`. @@ -1503,6 +1581,30 @@ extension APIProtocol { headers: headers )) } + /// - Remark: HTTP `POST /v1/chat-attention/seen`. + /// - Remark: Generated from `#/paths//v1/chat-attention/seen/post(postChatAttentionSeen)`. + public func postChatAttentionSeen( + headers: Operations.PostChatAttentionSeen.Input.Headers = .init(), + body: Operations.PostChatAttentionSeen.Input.Body + ) async throws -> Operations.PostChatAttentionSeen.Output { + try await postChatAttentionSeen(Operations.PostChatAttentionSeen.Input( + headers: headers, + body: body + )) + } + /// - Remark: HTTP `PUT /v1/chat-attention/views/{viewId}`. + /// - Remark: Generated from `#/paths//v1/chat-attention/views/{viewId}/put(putChatAttentionView)`. + public func putChatAttentionView( + path: Operations.PutChatAttentionView.Input.Path, + headers: Operations.PutChatAttentionView.Input.Headers = .init(), + body: Operations.PutChatAttentionView.Input.Body + ) async throws -> Operations.PutChatAttentionView.Output { + try await putChatAttentionView(Operations.PutChatAttentionView.Input( + path: path, + headers: headers, + body: body + )) + } /// The account's event relay: its URL, whether the Doorstep account token is set (plugin setting `doorstep:token`), and the connection status. /// /// - Remark: HTTP `GET /v1/event-relay`. @@ -1818,17 +1920,6 @@ extension APIProtocol { headers: headers )) } - /// - Remark: HTTP `GET /v1/group-chats/{id}/attachments/{entryId}/{index}`. - /// - Remark: Generated from `#/paths//v1/group-chats/{id}/attachments/{entryId}/{index}/get(getGroupAttachment)`. - public func getGroupAttachment( - path: Operations.GetGroupAttachment.Input.Path, - headers: Operations.GetGroupAttachment.Input.Headers = .init() - ) async throws -> Operations.GetGroupAttachment.Output { - try await getGroupAttachment(Operations.GetGroupAttachment.Input( - path: path, - headers: headers - )) - } /// - Remark: HTTP `GET /v1/group-chats/{id}/chat`. /// - Remark: Generated from `#/paths//v1/group-chats/{id}/chat/get(getGroupChatSnapshot)`. public func getGroupChatSnapshot( @@ -1857,6 +1948,54 @@ extension APIProtocol { headers: headers )) } + /// - Remark: HTTP `GET /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/get(listGroupFiles)`. + public func listGroupFiles( + path: Operations.ListGroupFiles.Input.Path, + query: Operations.ListGroupFiles.Input.Query = .init(), + headers: Operations.ListGroupFiles.Input.Headers = .init() + ) async throws -> Operations.ListGroupFiles.Output { + try await listGroupFiles(Operations.ListGroupFiles.Input( + path: path, + query: query, + headers: headers + )) + } + /// - Remark: HTTP `POST /v1/group-chats/{id}/files`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/post(uploadGroupFile)`. + public func uploadGroupFile( + path: Operations.UploadGroupFile.Input.Path, + headers: Operations.UploadGroupFile.Input.Headers, + body: Operations.UploadGroupFile.Input.Body + ) async throws -> Operations.UploadGroupFile.Output { + try await uploadGroupFile(Operations.UploadGroupFile.Input( + path: path, + headers: headers, + body: body + )) + } + /// - Remark: HTTP `GET /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/get(getGroupFile)`. + public func getGroupFile( + path: Operations.GetGroupFile.Input.Path, + headers: Operations.GetGroupFile.Input.Headers = .init() + ) async throws -> Operations.GetGroupFile.Output { + try await getGroupFile(Operations.GetGroupFile.Input( + path: path, + headers: headers + )) + } + /// - Remark: HTTP `DELETE /v1/group-chats/{id}/files/{fileId}`. + /// - Remark: Generated from `#/paths//v1/group-chats/{id}/files/{fileId}/delete(deleteGroupFile)`. + public func deleteGroupFile( + path: Operations.DeleteGroupFile.Input.Path, + headers: Operations.DeleteGroupFile.Input.Headers = .init() + ) async throws -> Operations.DeleteGroupFile.Output { + try await deleteGroupFile(Operations.DeleteGroupFile.Input( + path: path, + headers: headers + )) + } /// - Remark: HTTP `GET /v1/group-chats/{id}/history`. /// - Remark: Generated from `#/paths//v1/group-chats/{id}/history/get(getGroupChatHistory)`. public func getGroupChatHistory( @@ -2240,15 +2379,13 @@ extension APIProtocol { headers: headers )) } - /// - Remark: HTTP `PUT /v1/push/devices/{installationId}/presence`. - /// - Remark: Generated from `#/paths//v1/push/devices/{installationId}/presence/put(putPushPresence)`. - public func putPushPresence( - path: Operations.PutPushPresence.Input.Path, - headers: Operations.PutPushPresence.Input.Headers = .init(), - body: Operations.PutPushPresence.Input.Body - ) async throws -> Operations.PutPushPresence.Output { - try await putPushPresence(Operations.PutPushPresence.Input( - path: path, + /// - Remark: HTTP `POST /v1/reasoning/preview`. + /// - Remark: Generated from `#/paths//v1/reasoning/preview/post(previewReasoning)`. + public func previewReasoning( + headers: Operations.PreviewReasoning.Input.Headers = .init(), + body: Operations.PreviewReasoning.Input.Body + ) async throws -> Operations.PreviewReasoning.Output { + try await previewReasoning(Operations.PreviewReasoning.Input( headers: headers, body: body )) @@ -2275,6 +2412,17 @@ extension APIProtocol { body: body )) } + /// - Remark: HTTP `POST /v1/schedules/preview`. + /// - Remark: Generated from `#/paths//v1/schedules/preview/post(previewSchedule)`. + public func previewSchedule( + headers: Operations.PreviewSchedule.Input.Headers = .init(), + body: Operations.PreviewSchedule.Input.Body + ) async throws -> Operations.PreviewSchedule.Output { + try await previewSchedule(Operations.PreviewSchedule.Input( + headers: headers, + body: body + )) + } /// - Remark: HTTP `PATCH /v1/schedules/{id}`. /// - Remark: Generated from `#/paths//v1/schedules/{id}/patch(updateSchedule)`. public func updateSchedule( diff --git a/apfelkern/Sources/apfelkern/GroupChatHost+Files.swift b/apfelkern/Sources/apfelkern/GroupChatHost+Files.swift new file mode 100644 index 0000000..3873ca7 --- /dev/null +++ b/apfelkern/Sources/apfelkern/GroupChatHost+Files.swift @@ -0,0 +1,65 @@ +import Foundation + +/// Attachments in bot and group chats: uploads before a send, and downloads by file ID for the open chat. +extension GroupChatHost { + /// The file IDs a pending bot or group send carries, uploading only the attachments an earlier attempt did not. + /// Nil once the send no longer belongs to this connection or is no longer pending, so a late upload neither sends + /// nor changes newer state. Uploads stay with their send, so no other chat or connection reuses them. + public func uploadFiles( + _ send: BotChatDelivery.Send, chat: String, requestID: String, generation: Int, + upload: (PendingAttachment) async throws -> String + ) async throws -> [String]? { + var fileIDs: [String] = [] + for file in send.attachments { + guard self.generation == generation, delivery.isPending(botID: chat, requestID: requestID) else { return nil } + if let fileID = delivery.uploadedFile(file.id, botID: chat, requestID: requestID) { + fileIDs.append(fileID) + continue + } + let fileID = try await upload(file) + guard self.generation == generation, + delivery.recordUpload(fileID, for: file.id, botID: chat, requestID: requestID) + else { return nil } + fileIDs.append(fileID) + } + return self.generation == generation ? fileIDs : nil + } + + /// The image cache key for an attachment in the open chat: its file ID, or for a bot entry without files, such as + /// a desktop screenshot, the entry and index. Nil when there is nothing to fetch, such as for a deleted file. + public func attachmentKey(_ message: Message, index: Int) -> String? { + guard let entryID = message.entryId, !entryID.hasPrefix("local:") else { return nil } + let chat = conversationKey + guard let files = message.attachments else { + return selectedGroupID.isEmpty ? "\(chat)/\(entryID)/\(index)" : nil + } + guard files.indices.contains(index) else { return nil } + let file = files[index] + guard !file.id.isEmpty, !file.deleted, !deletedFiles.contains(file.id, chat: chat) else { return nil } + return "\(chat)/\(file.id)" + } + + /// Downloads an attachment the open chat shows, by its file ID. Nil when `cached` already holds it, or when it + /// is no longer shown by the time it arrives: its file was deleted, or the chat or connection changed. + public func downloadAttachment(entryID: String, index: Int, cached: (String) -> Bool) async + -> (key: String, data: Data)? { + guard let client, let message = messages.first(where: { $0.entryId == entryID }), + let key = attachmentKey(message, index: index), !cached(key) + else { return nil } + let generation = generation + let agentID = selectedAgentID + let groupID = selectedGroupID + let fileID = message.attachments.map { $0[index].id } + let data: Data? + if let fileID { + data = groupID.isEmpty + ? try? await client.file(agentID, fileID: fileID) : try? await client.groupFile(groupID, fileID: fileID) + } else { + data = try? await client.attachment(agentID, entryID: entryID, index: index) + } + guard let data, !data.isEmpty, self.generation == generation, + let current = messages.first(where: { $0.entryId == entryID }), attachmentKey(current, index: index) == key + else { return nil } + return (key, data) + } +} diff --git a/apfelkern/Sources/apfelkern/GroupChatHost.swift b/apfelkern/Sources/apfelkern/GroupChatHost.swift index 985d645..24664a9 100644 --- a/apfelkern/Sources/apfelkern/GroupChatHost.swift +++ b/apfelkern/Sources/apfelkern/GroupChatHost.swift @@ -12,6 +12,8 @@ public protocol GroupChatHost: AnyObject, Sendable { var streamsSuspended: Bool { get } var route: Route? { get set } + /// The open bot chat; empty while a group chat or nothing is open. + var selectedAgentID: String { get } var selectionVersion: Int { get set } var groupChats: [GroupChat] { get set } var selectedGroupID: String { get set } @@ -36,11 +38,17 @@ public protocol GroupChatHost: AnyObject, Sendable { var failedReplyTo: String { get set } var failedAttachments: [UUID] { get set } var delivery: BotChatDelivery { get set } + /// Files the open connection's transcripts reported deleted; a new connection clears it. + var deletedFiles: DeletedFiles { get set } var errorText: String { get set } var streamStatus: String { get set } + /// Counts snapshots applied to the open chat, so a late reload can tell a newer one overtook it. + var snapshotRevision: Int { get set } /// Stops the open bot chat's stream and clears its selection, so a group can take its place. func leaveBotChat() + /// Merges a bot chat snapshot into the open bot chat, keeping older pages and messages still sending. + func applySnapshot(_ incoming: ChatSnapshot) func request(_ work: @escaping @MainActor (APIClient) async throws -> (@MainActor () -> Void)?) func optimisticMutation( key: String, @@ -54,6 +62,11 @@ public protocol GroupChatHost: AnyObject, Sendable { extension GroupChatHost { public var streamsSuspended: Bool { false } + /// Where the open conversation's optimistic messages live, and the chat its file IDs belong to. + public var conversationKey: String { + selectedGroupID.isEmpty ? selectedAgentID : GroupChat.deliveryKey(selectedGroupID) + } + /// Loads the group list quietly: a failed load leaves the list as it is. public func loadGroupChats() { guard let client else { return } @@ -125,10 +138,12 @@ extension GroupChatHost { /// Keeps older pages the owner already loaded; snapshots only carry the newest page. public func applyGroupSnapshot(_ incoming: GroupChatSnapshot) { + snapshotRevision += 1 let key = GroupChat.deliveryKey(selectedGroupID) delivery.acknowledge(botID: key, requestIDs: Set(incoming.messages.compactMap(\.requestId))) let known = Set(messages.map(\.id)) - messages = mergeMessages(messages.filter { $0.deliveryState == .confirmed }, incoming.messages) + messages = deletedFiles.reconcile( + mergeMessages(messages.filter { $0.deliveryState == .confirmed }, incoming.messages), chat: key) messages.append(contentsOf: delivery.messages(botID: key)) // The first snapshot is history, and the owner's own message is already on screen. if groupSnapshot != nil, @@ -179,6 +194,34 @@ extension GroupChatHost { } } + /// A live reply can arrive before the open chat's snapshot names its event, so the chat on screen reloads its + /// newest page. A snapshot that lands first, a newer reload, or a new selection or connection drops this one; the + /// merge keeps drafts and messages still sending. + public func refreshReplyReferences(after event: ActivityEvent, active: Bool) { + guard event.type == "reply", active, !streamsSuspended, let client, let chat = route?.attentionChat, + chat == event.attentionChat + else { return } + snapshotRevision += 1 + let revision = snapshotRevision + let version = selectionVersion + let generation = generation + Task { + @MainActor func current() -> Bool { + self.generation == generation && selectionVersion == version && snapshotRevision == revision + && route?.attentionChat == chat + } + switch chat.kind { + case .bot: + guard let snapshot = try? await client.chat(chat.id), current(), selectedAgentID == chat.id else { return } + applySnapshot(snapshot) + case .group: + guard let snapshot = try? await client.groupChat(chat.id), current(), selectedGroupID == chat.id + else { return } + applyGroupSnapshot(snapshot) + } + } + } + /// Follows the open group on a new connection, such as after sleep or the background; the first snapshot catches up. public func reconnectGroupStream() { guard let client, !selectedGroupID.isEmpty else { return } @@ -216,8 +259,12 @@ extension GroupChatHost { let version = selectionVersion return Task { do { + guard let fileIDs = try await uploadFiles( + record, chat: key, requestID: requestID, generation: generation, + upload: { try await client.uploadGroupFile(id, $0) }) + else { return } try await client.sendGroupMessage( - id, content: content, requestID: requestID, replyTo: reply, attachments: files.map(\.outgoing)) + id, content: content, requestID: requestID, replyTo: reply, files: fileIDs) guard self.generation == generation else { return } delivery.accepted(botID: key, requestID: requestID) guard selectionVersion == version, selectedGroupID == id else { return } @@ -235,7 +282,8 @@ extension GroupChatHost { } } - /// Re-sends a failed group message with its original idempotency key and attachments. + /// Re-sends a failed group message with its original idempotency key and attachments, uploading only the files + /// an earlier attempt did not. public func retryGroupMessage(_ message: Message) { let id = selectedGroupID let key = GroupChat.deliveryKey(id) @@ -254,9 +302,12 @@ extension GroupChatHost { let version = selectionVersion Task { do { + guard let fileIDs = try await uploadFiles( + record, chat: key, requestID: requestID, generation: generation, + upload: { try await client.uploadGroupFile(id, $0) }) + else { return } try await client.sendGroupMessage( - id, content: record.content, requestID: requestID, replyTo: record.replyTo, - attachments: record.attachments.map(\.outgoing)) + id, content: record.content, requestID: requestID, replyTo: record.replyTo, files: fileIDs) guard self.generation == generation else { return } delivery.accepted(botID: key, requestID: requestID) if selectionVersion == version, selectedGroupID == id { sending = false } @@ -270,7 +321,7 @@ extension GroupChatHost { private func failGroupMessage(_ error: Error, id: String, requestID: String, version: Int) -> Bool { let current = selectionVersion == version && selectedGroupID == id if current { sending = false } - guard delivery.fail(botID: GroupChat.deliveryKey(id), requestID: requestID) else { return false } + guard delivery.fail(botID: GroupChat.deliveryKey(id), requestID: requestID, error: error) else { return false } if current { errorText = "Message was not confirmed: " + friendlyError(error) if let visible = messages.firstIndex(where: { $0.requestId == requestID }) { @@ -304,7 +355,8 @@ extension GroupChatHost { return { [self] in guard selectionVersion == version, selectedGroupID == id else { return } loadingOlder = false - messages = mergeMessages(messages, page.messages ?? []) + messages = deletedFiles.reconcile( + mergeMessages(messages, page.messages ?? []), chat: GroupChat.deliveryKey(id)) hasMore = page.hasMore ?? false oldestEntryID = page.oldestEntryId ?? "" } diff --git a/apfelkern/Sources/apfelkern/GroupChats.swift b/apfelkern/Sources/apfelkern/GroupChats.swift index 3ebe708..c86f4b3 100644 --- a/apfelkern/Sources/apfelkern/GroupChats.swift +++ b/apfelkern/Sources/apfelkern/GroupChats.swift @@ -1,4 +1,5 @@ import Foundation +import OpenAPIRuntime /// A conversation between the owner and two to six bots, with one shared transcript. public struct GroupChat: Codable, Identifiable, Hashable, Sendable { @@ -82,16 +83,6 @@ public struct GroupChatSnapshot: Codable, Sendable { } } -/// A file on its way into a group chat, in the shape the group messages endpoint takes. -public typealias OutgoingGroupAttachment = - Operations.SendGroupMessage.Input.Body.JsonPayload.AttachmentsPayloadPayload - -extension OutgoingGroupAttachment { - public init(_ attachment: OutgoingAttachment) { - self.init(data: attachment.data, mimeType: attachment.mimeType, name: attachment.name) - } -} - extension GroupChat { init(wire: Components.Schemas.GroupChat) { self.init(id: wire.id, name: wire.name, memberIds: wire.memberIds, createdAt: wire.createdAt, @@ -160,14 +151,21 @@ extension APIClient { } } + /// Uploads a file into the group's library and returns its ID, which a message then carries in `files`. + public func uploadGroupFile(_ id: String, _ file: PendingAttachment) async throws -> String { + try await invoke(timeout: 120, headers: ["Content-Type": file.mimeType]) { + try await $0.uploadGroupFile(.init( + path: .init(id: id), headers: .init(xFileName: file.name), + body: .any(HTTPBody(file.data)))).created.body.json.file.id + } + } + public func sendGroupMessage( - _ id: String, content: String, requestID: String, replyTo: String = "", - attachments: [OutgoingAttachment] = [] + _ id: String, content: String, requestID: String, replyTo: String = "", files: [String] = [] ) async throws { let body = Operations.SendGroupMessage.Input.Body.JsonPayload( - attachments: attachments.isEmpty ? nil : attachments.map(OutgoingGroupAttachment.init), - content: content, replyTo: replyTo.nilIfEmpty, requestId: requestID) - try await invoke(timeout: attachments.isEmpty ? 20 : 120) { + content: content, files: files.isEmpty ? nil : files, replyTo: replyTo.nilIfEmpty, requestId: requestID) + try await invoke(timeout: files.isEmpty ? 20 : 120) { _ = try await $0.sendGroupMessage(.init(path: .init(id: id), body: .json(body))).created } } @@ -177,10 +175,10 @@ extension APIClient { try await invoke { _ = try await $0.stopGroupChat(.init(path: .init(id: id))).noContent } } - public func groupAttachment(_ id: String, entryID: String, index: Int) async throws -> Data { - try await invoke { - let body = try await $0.getGroupAttachment(.init( - path: .init(id: id, entryId: entryID, index: index))).ok.body.any + /// A file from the group's library, by the ID a transcript message lists. + public func groupFile(_ id: String, fileID: String) async throws -> Data { + try await invoke(timeout: 120) { + let body = try await $0.getGroupFile(.init(path: .init(id: id, fileId: fileID))).ok.body.binary return try await Data(collecting: body, upTo: .max) } } diff --git a/apfelkern/Sources/apfelkern/HeldActionBoard.swift b/apfelkern/Sources/apfelkern/HeldActionBoard.swift index 49fd52c..fa309e4 100644 --- a/apfelkern/Sources/apfelkern/HeldActionBoard.swift +++ b/apfelkern/Sources/apfelkern/HeldActionBoard.swift @@ -74,6 +74,12 @@ public final class HeldActionBoard { return .outcome(readFailed ? "Unavailable" : "Loading…") } + /// The card shows the action as the server reported it: waiting once a read answered for it, or settled. + public func isReady(_ id: String) -> Bool { + guard let action = actions[id] else { return false } + return action.status != .pending || answered.contains(id) + } + public func decision(for id: String) -> HeldActionDecision { decisions[id] ?? HeldActionDecision() } diff --git a/apfelkern/Sources/apfelkern/Job.swift b/apfelkern/Sources/apfelkern/Job.swift index 472cadf..8258e3d 100644 --- a/apfelkern/Sources/apfelkern/Job.swift +++ b/apfelkern/Sources/apfelkern/Job.swift @@ -83,7 +83,7 @@ public struct JobHistory: Identifiable, Sendable { public let agentID: String public let kind: JobKind public let name: String - public var messages: [Message] = [] + public var items: [JobHistoryItem] = [] public var hasMore = false public var oldestEntryID = "" public var loaded = false @@ -103,6 +103,23 @@ public struct JobHistory: Identifiable, Sendable { } } +/// A page of a job's history: its transcript messages and the items the server read from them. +public struct JobHistoryPage: Sendable { + public var messages: [Message] + public var items: [JobHistoryItem] + public var hasMore: Bool + public var oldestEntryId: String? + + public init( + messages: [Message] = [], items: [JobHistoryItem] = [], hasMore: Bool = false, oldestEntryId: String? = nil + ) { + self.messages = messages + self.items = items + self.hasMore = hasMore + self.oldestEntryId = oldestEntryId + } +} + /// Tokens and cost of a job's own model requests, as one short line: "1,000 in · 500 out · $0.0020". /// Subscription providers report zero cost, which says nothing, so the line leaves it out. public func usageLine(_ usage: JobUsage, locale: Locale = .current) -> String { @@ -131,7 +148,7 @@ extension APIClient { } public func jobHistory(_ kind: JobKind, agentID: String, name: String, before: String, limit: Int) - async throws -> ChatHistoryResponse { + async throws -> JobHistoryPage { switch kind { case .coding: try await codingJobHistory(agentID, name: name, before: before, limit: limit) case .desktop: try await desktopJobHistory(agentID, name: name, before: before, limit: limit) @@ -144,8 +161,8 @@ extension APIClient { var before = "" repeat { let page = try await jobHistory(kind, agentID: agentID, name: name, before: before, limit: 200) - pages.append(page.messages ?? []) - before = page.hasMore == true ? page.oldestEntryId ?? "" : "" + pages.append(page.messages) + before = page.hasMore ? page.oldestEntryId ?? "" : "" } while !before.isEmpty return pages.reversed().flatMap(\.self) } diff --git a/apfelkern/Sources/apfelkern/JobBoard.swift b/apfelkern/Sources/apfelkern/JobBoard.swift index 8226237..01bd24c 100644 --- a/apfelkern/Sources/apfelkern/JobBoard.swift +++ b/apfelkern/Sources/apfelkern/JobBoard.swift @@ -43,6 +43,8 @@ public final class JobBoard { agentID = "" jobs = [:] history = nil + historyLoad += 1 + historyLoading = false answers = [:] listed = [] answered = [] @@ -124,7 +126,7 @@ public final class JobBoard { while !Task.isCancelled { try? await Task.sleep(for: delay) guard !Task.isCancelled else { return } - if openJobWorks { loadHistory(client: client) } + if openJobWorks && !historyLoading { loadHistory(client: client) } var kinds: Set = history.map { [$0.kind] } ?? [.coding] if questionOpen { kinds.insert(.coding) } for kind in kinds { refresh(kind, agentID: agentID, client: client) } @@ -142,39 +144,72 @@ public final class JobBoard { history = nil } + /// Counts history loads, so only the newest one applies; an older load that finishes late would + /// otherwise cut the items a newer one added. + private var historyLoad = 0 + private var historyLoading = false + public func loadHistory(client: APIClient) { guard let open = history else { return } + historyLoad += 1 + let load = historyLoad + historyLoading = true Task { + defer { + if load == historyLoad { historyLoading = false } + } do { let page = try await client.jobHistory( - open.kind, agentID: open.agentID, name: open.name, before: "", limit: 100) + open.kind, agentID: open.agentID, name: open.name, before: "", limit: Self.pageSize) + let steps = await refreshedSteps(of: open, newest: page, client: client) // Changed as a copy: reading the observed property while writing it is an exclusivity violation. - guard var current = history, current.id == open.id else { return } - current.messages = mergeMessages(current.messages, page.messages ?? []) + guard load == historyLoad, var current = history, current.id == open.id else { return } + current.items = mergeJobItems(current.items.map { steps[$0.id] ?? $0 }, page.items) if !current.loaded { - current.hasMore = page.hasMore ?? false + current.hasMore = page.hasMore current.oldestEntryID = page.oldestEntryId ?? "" } current.loaded = true current.error = "" history = current } catch { - guard history?.id == open.id else { return } + guard load == historyLoad, history?.id == open.id else { return } history?.error = friendlyError(error) } } } + private static let pageSize = 100 + + /// The newest page's items, plus unfinished steps loaded from older pages, read again from those pages: + /// a step's result reaches the page that holds its call, which the newest page may have scrolled past. + /// An older page that fails to load ends the search, keeping the steps found so far. + private func refreshedSteps(of open: JobHistory, newest page: JobHistoryPage, client: APIClient) + async -> [String: JobHistoryItem] { + var steps = Dictionary(page.items.map { ($0.id, $0) }, uniquingKeysWith: { _, last in last }) + var waiting = Set(open.items.filter(\.isUnfinishedStep).map(\.id)).subtracting(steps.keys) + var before = page.hasMore ? page.oldestEntryId ?? "" : "" + var visited: Set = [] + while !waiting.isEmpty, !before.isEmpty, visited.insert(before).inserted { + guard let older = try? await client.jobHistory( + open.kind, agentID: open.agentID, name: open.name, before: before, limit: Self.pageSize) else { break } + for item in older.items where waiting.remove(item.id) != nil { steps[item.id] = item } + before = older.hasMore ? older.oldestEntryId ?? "" : "" + } + return steps + } + public func loadOlderHistory(client: APIClient) { guard let open = history, open.hasMore, !open.loadingOlder, !open.oldestEntryID.isEmpty else { return } history?.loadingOlder = true Task { do { let page = try await client.jobHistory( - open.kind, agentID: open.agentID, name: open.name, before: open.oldestEntryID, limit: 100) + open.kind, agentID: open.agentID, name: open.name, before: open.oldestEntryID, limit: Self.pageSize) guard var current = history, current.id == open.id else { return } - current.messages = mergeMessages(current.messages, page.messages ?? []) - current.hasMore = page.hasMore ?? false + let known = Set(current.items.map(\.id)) + current.items = page.items.filter { !known.contains($0.id) } + current.items + current.hasMore = page.hasMore current.oldestEntryID = page.oldestEntryId ?? "" current.loadingOlder = false history = current diff --git a/apfelkern/Sources/apfelkern/JobTranscript.swift b/apfelkern/Sources/apfelkern/JobTranscript.swift index b104ddc..0670851 100644 --- a/apfelkern/Sources/apfelkern/JobTranscript.swift +++ b/apfelkern/Sources/apfelkern/JobTranscript.swift @@ -34,18 +34,16 @@ public struct JobTranscript: Hashable, Sendable, Transferable { } private static func assistantSections(of message: Message) -> [String] { - guard case .array(let blocks)? = message.blocks else { - return message.text.isEmpty ? [] : [message.text] - } + guard let blocks = message.blocks else { return message.text.isEmpty ? [] : [message.text] } return blocks.compactMap { block in - switch block["type"]?.stringValue { - case "text": - let text = block["text"]?.stringValue ?? "" - return text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? nil : text - case "toolCall": - guard let name = block["name"]?.stringValue, !name.isEmpty else { return nil } - return "### \(name)\n\n\(fenced(json(block["arguments"] ?? .object([:])), info: "json"))" - default: + switch block { + case .text(let text): + return text.text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? nil : text.text + case .toolCall(let call): + guard !call.name.isEmpty else { return nil } + let arguments = (try? JSONValue(wire: call.arguments)) ?? .object([:]) + return "### \(call.name)\n\n\(fenced(json(arguments), info: "json"))" + case .thinking, .image: return nil } } diff --git a/apfelkern/Sources/apfelkern/Models.swift b/apfelkern/Sources/apfelkern/Models.swift index f1754c8..871318e 100644 --- a/apfelkern/Sources/apfelkern/Models.swift +++ b/apfelkern/Sources/apfelkern/Models.swift @@ -319,6 +319,12 @@ public struct Schedule: Codable, Identifiable, Hashable, Sendable { public var nextRunAt: String? /// The bot that saved this automation. Nil when the owner saved it. public var createdByAgentId: String? + /// When it runs, in the server's words: its event source, its cron in words, or its one time. + public var description: String + /// `description` as the list beside its switch shows it, where a paused one says so. + public var timing: String + /// When it next runs, close by in words; a dash when paused or finished. + public var nextRunLabel: String public init( id: String, @@ -335,7 +341,10 @@ public struct Schedule: Codable, Identifiable, Hashable, Sendable { eventSourceId: String? = nil, enabled: Bool, nextRunAt: String? = nil, - createdByAgentId: String? = nil + createdByAgentId: String? = nil, + description: String = "", + timing: String = "", + nextRunLabel: String = "" ) { self.id = id self.agentId = agentId @@ -352,6 +361,9 @@ public struct Schedule: Codable, Identifiable, Hashable, Sendable { self.enabled = enabled self.nextRunAt = nextRunAt self.createdByAgentId = createdByAgentId + self.description = description + self.timing = timing + self.nextRunLabel = nextRunLabel } } diff --git a/apfelkern/Sources/apfelkern/Reasoning.swift b/apfelkern/Sources/apfelkern/Reasoning.swift index d47364d..4457f21 100644 --- a/apfelkern/Sources/apfelkern/Reasoning.swift +++ b/apfelkern/Sources/apfelkern/Reasoning.swift @@ -5,39 +5,47 @@ public enum ThinkingLevel: String, CaseIterable, Codable, Identifiable, Sendable case off, minimal, low, medium, high, xhigh, max public var id: String { rawValue } +} - public var title: String { - switch self { - case .off: "Off" - case .minimal: "Minimal" - case .low: "Low" - case .medium: "Medium" - case .high: "High" - case .xhigh: "Extra high" - case .max: "Maximum" - } - } +/// A level a model offers, with the server's label for it. +public struct ReasoningOption: Hashable, Identifiable, Sendable { + public var level: ThinkingLevel + public var label: String + + public var id: ThinkingLevel { level } - /// The level a turn runs at: the nearest supported one, preferring higher, as Pi AI's `clampThinkingLevel`. - public func clamped(to levels: [ThinkingLevel]) -> ThinkingLevel { - guard !levels.contains(self) else { return self } - let lower = Self.allCases.prefix { $0 != self } - let higher = Self.allCases.dropFirst(lower.count + 1) - return higher.first(where: levels.contains) ?? lower.last(where: levels.contains) ?? levels.first ?? .off + public init(level: ThinkingLevel, label: String) { + self.level = level + self.label = label } +} + +/// The server's reasoning policy for a model: the levels it offers and the one a turn runs at, which a model +/// that lacks the chosen level clamps. +public struct ReasoningPreview: Hashable, Sendable { + public var options: [ReasoningOption] + public var effectiveLevel: ThinkingLevel - /// What a model supports. As on the web, a model the server doesn't list offers every level. - public static func available(for model: String?, in models: [ModelSummary]) -> [ThinkingLevel] { - let id = model?.trimmingCharacters(in: .whitespacesAndNewlines) - return models.first { $0.id == id }?.thinkingLevels ?? allCases + public init(options: [ReasoningOption], effectiveLevel: ThinkingLevel) { + self.options = options + self.effectiveLevel = effectiveLevel } + + public var label: String { options.first { $0.level == effectiveLevel }?.label ?? effectiveLevel.rawValue } } -/// The reasoning control in a bot chat's composer. A choice shows on the bot at once and rolls back if the -/// server refuses it. Model lists from an earlier connection are dropped. +/// The server's reasoning previews for the composer's control and the bot form. A choice in the composer shows +/// on the bot at once and rolls back if the server refuses it. Previews from an earlier connection are dropped. @MainActor @Observable public final class ReasoningBoard { - private var models: [String: [ModelSummary]] = [:] + private struct Key: Hashable { + var provider: String + var model: String + var level: ThinkingLevel + } + + /// The server's previews on this connection; a model's levels change only with the server. + private var previews: [Key: ReasoningPreview] = [:] private var connection = 0 /// Bots with a write on its way; a second could land out of order. public private(set) var saving: Set = [] @@ -46,29 +54,51 @@ public final class ReasoningBoard { public func reset() { connection += 1 - models = [:] + previews = [:] saving = [] } - /// Reads the provider's models again each time, because a new key or sign-in changes them. - public func load(provider: String, client: APIClient) async { - let loadedFor = connection - let loaded = try? await client.models(provider: provider) - guard !Task.isCancelled, loadedFor == connection else { return } - models[provider] = loaded ?? models[provider] ?? [] + private static func key(provider: String?, model: String?, level: String) -> Key? { + guard let provider = provider?.nilIfEmpty else { return nil } + return Key( + provider: provider, model: model?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "", + level: ThinkingLevel(rawValue: level) ?? .off) + } + + /// Nil until the server answers, which keeps a reasoning control hidden. Meanwhile a level the server + /// offered for the same model shows as itself, so a choice doesn't hide the control while it loads. + public func preview(provider: String?, model: String?, level: String) -> ReasoningPreview? { + guard let key = Self.key(provider: provider, model: model, level: level) else { return nil } + if let preview = previews[key] { return preview } + let offered = previews.first { other, preview in + other.provider == key.provider && other.model == key.model && preview.options.contains { $0.level == key.level } + } + return offered.map { ReasoningPreview(options: $0.value.options, effectiveLevel: key.level) } + } + + public func preview(of bot: Agent) -> ReasoningPreview? { + preview(provider: bot.provider, model: bot.model, level: bot.inference?.thinkingLevel ?? "off") } - /// Empty until the models arrive, which keeps the control hidden. As on the web, a model the server - /// doesn't list offers every level. - public func levels(of bot: Agent) -> [ThinkingLevel] { - guard let provider = bot.provider, let models = models[provider] else { return [] } - return ThinkingLevel.available(for: bot.model, in: models) + /// Asks the server once the inputs have held for `delay`. Cancelling the task, as SwiftUI does when its + /// inputs change, drops the request and any late answer. A failed request shows no preview. + public func load( + provider: String?, model: String?, level: String, client: APIClient, after delay: Duration = .milliseconds(250) + ) async { + guard let key = Self.key(provider: provider, model: model, level: level), previews[key] == nil else { return } + let loadedFor = connection + try? await Task.sleep(for: delay) + guard !Task.isCancelled, loadedFor == connection, + let loaded = try? await client.previewReasoning(provider: key.provider, model: key.model, level: key.level), + !Task.isCancelled, loadedFor == connection + else { return } + previews[key] = loaded } - /// The level the bot's turns run at, which a model that lacks the saved one clamps. - public func level(of bot: Agent) -> ThinkingLevel { - let saved = bot.inference.flatMap { ThinkingLevel(rawValue: $0.thinkingLevel) } ?? .off - return saved.clamped(to: levels(of: bot)) + public func load(bot: Agent, client: APIClient, after delay: Duration = .milliseconds(250)) async { + await load( + provider: bot.provider, model: bot.model, level: bot.inference?.thinkingLevel ?? "off", client: client, + after: delay) } public func choose(_ level: ThinkingLevel, for id: String, host: some BotListHost) { diff --git a/apfelkern/Sources/apfelkern/ReplyAttention.swift b/apfelkern/Sources/apfelkern/ReplyAttention.swift new file mode 100644 index 0000000..2becfcc --- /dev/null +++ b/apfelkern/Sources/apfelkern/ReplyAttention.swift @@ -0,0 +1,180 @@ +import CoreGraphics +import Foundation + +/// A bot or group chat as chat attention names it. Bot and group IDs are separate namespaces, so a group's member +/// bot chat is not the group chat. +public struct ChatAttentionChat: Hashable, Sendable { + public enum Kind: String, Hashable, Sendable { + case bot + case group + } + + public var kind: Kind + public var id: String + + public init(kind: Kind, id: String) { + self.kind = kind + self.id = id + } + + public static func bot(_ id: String) -> Self { Self(kind: .bot, id: id) } + public static func group(_ id: String) -> Self { Self(kind: .group, id: id) } +} + +extension Route { + /// The chat this route shows; panels show none. + public var attentionChat: ChatAttentionChat? { + switch self { + case .agent(let id): .bot(id) + case .group(let id): .group(id) + default: nil + } + } +} + +extension ActivityEvent { + /// The chat a reply belongs to: its group when it has one, otherwise its bot's chat. + public var attentionChat: ChatAttentionChat { + groupId?.nilIfEmpty.map(ChatAttentionChat.group) ?? .bot(agentId) + } +} + +/// The rendered part of a message whose display acknowledges a reply. +public enum ReplySurface: Hashable, Sendable { + /// The reply's text, without its citations. + case text + /// A waiting request card, named by its tool call. + case toolCard(String) + /// A held action's card, named by the action. + case heldAction(String) +} + +/// A notification reply event and the exact surface that shows it. +public struct ReplyReference: Codable, Hashable, Sendable { + typealias Wire = Components.Schemas.TranscriptMessage.ReplyReferencesPayloadPayload + + public var eventId: String + public var surface: ReplySurface + + public init(eventId: String, surface: ReplySurface) { + self.eventId = eventId + self.surface = surface + } + + init(wire: Wire) { + eventId = wire.eventId + surface = switch wire.surface { + case .case1: .text + case .case2(let card): .toolCard(card.toolCallId) + case .case3(let held): .heldAction(held.actionId) + } + } + + public init(from decoder: Decoder) throws { + self.init(wire: try Wire(from: decoder)) + } + + public func encode(to encoder: Encoder) throws { + let surface: Wire.SurfacePayload = switch self.surface { + case .text: .case1(.init(kind: .text)) + case .toolCard(let id): .case2(.init(kind: .toolCard, toolCallId: id)) + case .heldAction(let id): .case3(.init(actionId: id, kind: .heldAction)) + } + try Wire(eventId: eventId, surface: surface).encode(to: encoder) + } +} + +extension Message { + /// The events this exact surface acknowledges once the owner sees it, each once. + public func attentionEventIDs(for surface: ReplySurface) -> [String] { + var seen = Set() + return replyReferences.filter { $0.surface == surface }.map(\.eventId).filter { seen.insert($0).inserted } + } + + /// A bot's reply text, once it has words to read; citations alone don't count. + public var showsReplyText: Bool { + role == "assistant" && !presentedText.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + } + + /// The waiting card a reply reference can name, and whether the card shows its server state rather than a + /// placeholder. A loading or unavailable card isn't ready; a settled one the server confirmed is. + @MainActor public func replyCard( + heldActions: HeldActionBoard, botRequests: BotRequestBoard, callRequests: CallRequestBoard, + botSecrets: BotSecretBoard + ) -> (surface: ReplySurface, ready: Bool)? { + if kind == HeldActionEvent.messageKind, let held = heldAction { + return (.heldAction(held.id), heldActions.isReady(held.id)) + } + guard role == "toolResult", let toolCallId = toolCallId?.nilIfEmpty else { return nil } + if let request = BotRequest(message: self) { return (.toolCard(toolCallId), botRequests.isLoaded(request.id)) } + if let request = CallRequest(message: self) { return (.toolCard(toolCallId), callRequests.isLoaded(request.id)) } + if let ask = BotSecretAsk(message: self) { return (.toolCard(toolCallId), botSecrets.isReady(ask)) } + return nil + } +} + +/// True when a ready surface has some area inside the chat's viewport. Touching its edge isn't enough. +public func replySurfaceVisible(ready: Bool, frame: CGRect, viewport: CGRect) -> Bool { + guard ready else { return false } + let shown = frame.intersection(viewport) + return !shown.isNull && shown.width > 0 && shown.height > 0 +} + +/// The reply surfaces a chat has laid out, each framed in its scroll view's coordinates. A lazy list lays out only +/// rows near the screen, and a row that goes away takes its surfaces with it. +public struct ReplySurfaces: Sendable { + private struct Key: Hashable { + var chat: ChatAttentionChat + var surface: String + } + + private struct Surface { + var frame: CGRect + var container: CGSize + var eventIDs: [String] + var ready: Bool + } + + /// What the toolbar and composer cover at the scroll view's top and bottom edges. + private var top: CGFloat = 0 + private var bottom: CGFloat = 0 + private var surfaces: [Key: Surface] = [:] + + public init() {} + + public mutating func setInsets(top: CGFloat, bottom: CGFloat) { + self.top = max(0, top) + self.bottom = max(0, bottom) + } + + /// A surface's frame and its scroll view's size, both in the scroll view's coordinates. + public mutating func set( + _ key: String, of chat: ChatAttentionChat, frame: CGRect, container: CGSize, eventIDs: [String], ready: Bool + ) { + surfaces[Key(chat: chat, surface: key)] = Surface( + frame: frame, container: container, eventIDs: eventIDs, ready: ready) + } + + public mutating func remove(_ key: String, of chat: ChatAttentionChat) { + surfaces[Key(chat: chat, surface: key)] = nil + } + + /// Forgets every other chat's surfaces. + public mutating func keep(only chat: ChatAttentionChat?) { + surfaces = surfaces.filter { $0.key.chat == chat } + } + + /// Events whose ready surface shows in the uncovered part of the chat's scroll view, each once. + public func visibleEventIDs(in chat: ChatAttentionChat) -> [String] { + var seen = Set() + return surfaces.filter { $0.key.chat == chat }.values + .filter { surface in + let viewport = CGRect( + x: 0, y: top, width: surface.container.width, + height: max(0, surface.container.height - top - bottom)) + return replySurfaceVisible(ready: surface.ready, frame: surface.frame, viewport: viewport) + } + .flatMap(\.eventIDs) + .filter { seen.insert($0).inserted } + } +} diff --git a/apfelkern/Sources/apfelkern/SourceCitations.swift b/apfelkern/Sources/apfelkern/SourceCitations.swift deleted file mode 100644 index 27bf1ca..0000000 --- a/apfelkern/Sources/apfelkern/SourceCitations.swift +++ /dev/null @@ -1,114 +0,0 @@ -import Foundation - -/// A page a bot searched or read in the turn that wrote a message. -public struct MessageSource: Codable, Hashable, Sendable { - public var url: String - public var title: String - - public init(url: String, title: String) { - self.url = url - self.title = title - } -} - -/// A cited page, shown once after the reply instead of as a link inside it. -public struct SourceChip: Hashable, Sendable { - public var href: String - public var title: String - - public init(href: String, title: String) { - self.href = href - self.title = title - } -} - -/// Takes a reply's citations of pages its turn read out of its text, as the web transcript does. -public enum SourceCitations { - // A private-use character marks where a chip was; bot text never contains it. - private static let slot = "\u{E000}" - private static let pageTools: Set = ["web_search", "web_extract"] - - /// Removes `[source](url)` links to known pages, outside code, and returns those pages once each. - public static func split(_ markdown: String, sources: [MessageSource]) -> (text: String, chips: [SourceChip]) { - let known = Dictionary( - sources.compactMap { source in key(source.url).map { ($0, source.title) } }, - uniquingKeysWith: { first, _ in first }) - guard !known.isEmpty else { return (markdown, []) } - var chips: [(key: String, chip: SourceChip)] = [] - var fenced = false - let lines = markdown.components(separatedBy: "\n").map { line -> String in - let fence = line.drop { $0 == " " || $0 == "\t" } - if fence.hasPrefix("```") || fence.hasPrefix("~~~") { - fenced.toggle() - return line - } - return fenced ? line : take(from: line, known: known, chips: &chips) - } - return (lines.joined(separator: "\n"), chips.map(\.chip)) - } - - /// For each bot reply, the pages its turn searched or read; a turn starts at each message to the bot. A bot chat has - /// no `sources` on the wire, so they come from its tool results; a group chat's server stores them on the message. - public static func byReply(_ messages: [Message]) -> [String: [MessageSource]] { - var replies: [String: [MessageSource]] = [:] - var turn: [MessageSource] = [] - for message in messages { - if message.role == "user" { turn = [] } - turn += pages(of: message) - if message.role == "assistant", !turn.isEmpty { replies[message.id] = turn } - } - return replies - } - - /// A page that could not be read carries an error instead of a title. - private static func pages(of message: Message) -> [MessageSource] { - guard message.role == "toolResult", message.isError != true, pageTools.contains(message.toolName ?? ""), - case .array(let pages)? = message.toolDetails - else { return [] } - return pages.compactMap { page in - guard let url = page["url"]?.stringValue, let title = page["title"]?.stringValue else { return nil } - return MessageSource(url: url, title: title) - } - } - - /// Ignores the fragment, a trailing slash, and the host's case, so a cited link matches the page that was read. - static func key(_ href: String) -> String? { - guard let url = URLComponents(string: href), ["http", "https"].contains(url.scheme?.lowercased()), - let host = url.host?.lowercased().nilIfEmpty - else { return nil } - var path = url.percentEncodedPath - while path.hasSuffix("/") { path.removeLast() } - return host + (url.port.map { ":\($0)" } ?? "") + path + (url.percentEncodedQuery.map { "?" + $0 } ?? "") - } - - private static func take( - from line: String, known: [String: String], chips: inout [(key: String, chip: SourceChip)] - ) -> String { - var result = "" - var rest = line[...] - for code in line.ranges(of: #/`[^`]*`/#) { - result += clean(rest[rest.startIndex.. String { - var found = chips - let marked = prose.replacing(#/(?i)\[sources?\]\((https?:\/\/[^\s()]*(?:\([^\s()]*\)[^\s()]*)*)\)/#) { match in - let href = String(match.output.1) - guard let key = key(href), let title = known[key] else { return String(match.output.0) } - if !found.contains(where: { $0.key == key }) { found.append((key, SourceChip(href: href, title: title))) } - return slot - } - chips = found - return String(marked) - .replacing(#/\x{E000}[ \t]*(?:,|;|&|and)[ \t]*(?=\x{E000})/#, with: slot) - // Only parentheses that held a citation go: a literal `()` in the prose is the bot's own text. - .replacing(#/(?i)[ \t]*\((?:\s*sources?:?)?[\s\x{E000}]*\x{E000}\s*\)/#, with: "") - .replacing(#/[ \t]*\x{E000}/#, with: "") - } -} diff --git a/apfelkern/Sources/apfelkern/Working.swift b/apfelkern/Sources/apfelkern/Working.swift index e89357a..656b18d 100644 --- a/apfelkern/Sources/apfelkern/Working.swift +++ b/apfelkern/Sources/apfelkern/Working.swift @@ -1,35 +1,9 @@ import Foundation -/// What a bot is doing during a turn, read from the transcript as the web's working status does. -public enum Working: String, Sendable { +/// What a bot is doing during a turn, as the server's chat snapshot reports it. +public enum Working: String, Codable, Sendable { case idle, thinking, writing, searching, remembering, tinkering, struggling, failed - private static let searchTools: Set = [ - "web_search", "web_extract", "history_search", "history_read" - ] - private static let memoryTool = "memory" - - public init(snapshot: ChatSnapshot?, messages: [Message]) { - switch snapshot?.status { - case "failed": self = .failed - case "running": - self = Self.turn(partial: snapshot?.partial, last: messages.last { $0.deliveryState == .confirmed }) - default: self = .idle - } - } - - private static func turn(partial: String?, last: Message?) -> Working { - if partial?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false { return .writing } - guard let last else { return .thinking } - if last.role == "toolResult", last.isError == true { return .struggling } - guard last.role == "assistant", case .array(let blocks)? = last.blocks else { return .thinking } - let tools = blocks.filter { $0["type"]?.stringValue == "toolCall" } - .map { $0["name"]?.stringValue ?? "" } - if tools.isEmpty { return .thinking } - if tools.contains(where: searchTools.contains) { return .searching } - return tools.contains(memoryTool) ? .remembering : .tinkering - } - public var label: String { switch self { case .idle, .failed: "Working" diff --git a/apfelkern/Tests/apfelkernTests/APIClientTests.swift b/apfelkern/Tests/apfelkernTests/APIClientTests.swift index 2b33d3f..2a064f5 100644 --- a/apfelkern/Tests/apfelkernTests/APIClientTests.swift +++ b/apfelkern/Tests/apfelkernTests/APIClientTests.swift @@ -58,7 +58,7 @@ import Testing } } -@Test func generatedMessagesRetainAttachmentTimeoutAndBody() async throws { +@Test func generatedMessagesCarryFileIDsWithAttachmentTimeout() async throws { let requests = Mutex(0) let execution = #""" {"id":"run","agentId":"bot","conversationId":"chat","scheduleId":null,"submissionId":null, @@ -72,43 +72,68 @@ import Testing let body = try requestJSON(request) #expect(body["timezone"] == .string("Europe/Berlin")) #expect(body["replyTo"] == nil) - #expect(body["attachments"] == .array([.object([ - "name": .string("a.png"), "mimeType": .string("image/png"), "data": .string("AQI=")])])) + #expect(body["attachments"] == nil) + #expect(body["files"] == .array([.string("f1"), .string("f2")])) return StubResponse(status: 202, body: Data(execution.utf8)) }) { client in try await client.sendChatMessage("bot", content: "hello", requestID: "request", replyTo: "", - attachments: [.init(name: "a.png", mimeType: "image/png", data: "AQI=")], timezone: "Europe/Berlin") + files: ["f1", "f2"], timezone: "Europe/Berlin") } #expect(requests.withLock { $0 } == 1) } -@Test func nullableGeneratedResourceFailsWithoutFabricatingAnAgent() async throws { - try await withClient(handler: { _ in StubResponse(body: Data("null".utf8)) }) { client in - await #expect(throws: DecodingError.self) { try await client.updateAgent("bot", patch: [:]) } +private let uploadedFile = #""" + {"file":{"id":"0b7c6a9e-7d3f-4c55-9d1a-1f1e5b2f3a40","name":"Trip plan ü.png","mimeType":"image/png", + "size":5,"createdAt":"now"},"existed":false} + """# + +@Test func uploadsSendRawBytesWithTheFileNameAndType() async throws { + let bytes = Data([0, 255, 13, 10, 128]) + let file = PendingAttachment(name: "Trip plan ü+&.png", mimeType: "image/png", data: bytes) + let paths = Mutex<[String]>([]) + try await withClient(handler: { request in + paths.withLock { $0.append(request.url?.path ?? "") } + #expect(request.httpMethod == "POST") + #expect(request.timeoutInterval == 120) + #expect(request.value(forHTTPHeaderField: "Content-Type") == "image/png") + #expect(request.value(forHTTPHeaderField: "X-File-Name") == "Trip%20plan%20%C3%BC%2B%26.png") + #expect(requestBody(request) == bytes) + return StubResponse(status: 201, body: Data(uploadedFile.utf8)) + }) { client in + let botFile = try await client.uploadFile("bot", file) + let groupFile = try await client.uploadGroupFile("trip", file) + #expect([botFile, groupFile] == Array(repeating: "0b7c6a9e-7d3f-4c55-9d1a-1f1e5b2f3a40", count: 2)) } + #expect(paths.withLock { $0 } == ["/prefix/v1/agents/bot/files", "/prefix/v1/group-chats/trip/files"]) } -@Test func generatedPushOperationsRetainPresenceTimeout() async throws { - let requests = Mutex(0) +@Test func filesDownloadByID() async throws { + let bytes = Data([137, 80, 78, 71]) + let paths = Mutex<[String]>([]) try await withClient(handler: { request in - requests.withLock { $0 += 1 } - #expect(request.timeoutInterval == 3) - #expect(request.httpMethod == "PUT") - #expect(request.url?.path == "/prefix/v1/push/devices/installation/presence") - let body = try requestJSON(request) - #expect(body["agentId"] == .null) - return StubResponse(status: 204, body: Data()) + paths.withLock { $0.append(request.url?.path ?? "") } + #expect(request.httpMethod == "GET") + return StubResponse(contentType: "application/octet-stream", body: bytes) }) { client in - try await client.pushPresence("installation", active: true, agentId: nil, timeout: 3) + let botFile = try await client.file("bot", fileID: "f1") + let groupFile = try await client.groupFile("trip", fileID: "f2") + #expect([botFile, groupFile] == [bytes, bytes]) + } + #expect(paths.withLock { $0 } == ["/prefix/v1/agents/bot/files/f1", "/prefix/v1/group-chats/trip/files/f2"]) +} + +@Test func nullableGeneratedResourceFailsWithoutFabricatingAnAgent() async throws { + try await withClient(handler: { _ in StubResponse(body: Data("null".utf8)) }) { client in + await #expect(throws: DecodingError.self) { try await client.updateAgent("bot", patch: [:]) } } - #expect(requests.withLock { $0 } == 1) } @Test func generatedSchedulePatchPreservesExplicitNullAndDate() async throws { let schedule = #""" {"id":"task","agentId":"bot","name":"Task","prompt":"hello","kind":"prompt","command":null, "timeoutSeconds":60,"notify":true,"eventSourceId":null,"cron":null,"timezone":"UTC", - "runAt":"2026-07-01T09:00:00.123Z","enabled":true,"nextRunAt":null,"createdAt":"now","createdByAgentId":null} + "runAt":"2026-07-01T09:00:00.123Z","enabled":true,"nextRunAt":null,"nextRunLabel":"","description":"", + "timing":"","createdAt":"now","createdByAgentId":null} """# try await withClient(handler: { request in let body = try requestJSON(request) @@ -197,13 +222,15 @@ private let groupSnapshot = #""" "activity":{"paused":true,"botTurns":8,"members":[ {"agentId":"ada","status":"running","error":null},{"agentId":"grace","status":"disabled","error":null}]}, "messages":[ - {"id":"trip:1:0","entryId":"trip:1","role":"user","content":"Pack light","origin":{"kind":"owner"}}, + {"id":"trip:1:0","entryId":"trip:1","role":"user","content":"Pack light","origin":{"kind":"owner"}, + "replyReferences":[]}, {"id":"trip:2:0","entryId":"trip:2","role":"toolResult","content":"Reacted 👍","toolName":"react", - "toolDetails":{"emoji":"👍"},"replyTo":"trip:1","origin":{"kind":"bot","agentId":"ada","name":"Ada"}}], + "toolDetails":{"emoji":"👍"},"replyTo":"trip:1","origin":{"kind":"bot","agentId":"ada","name":"Ada"}, + "replyReferences":[]}], "hasMore":false,"oldestEntryId":"trip:1","updatedAt":1} """# -@Test func groupMessagesCarryReplyAndAttachments() async throws { +@Test func groupMessagesCarryReplyAndFileIDs() async throws { let requests = Mutex(0) try await withClient(handler: { request in requests.withLock { $0 += 1 } @@ -213,13 +240,12 @@ private let groupSnapshot = #""" let body = try requestJSON(request) #expect(body["content"] == .string("Route attached")) #expect(body["replyTo"] == .string("trip:3")) - #expect(body["attachments"] == .array([.object([ - "name": .string("map.png"), "mimeType": .string("image/png"), "data": .string("AQI=")])])) + #expect(body["attachments"] == nil) + #expect(body["files"] == .array([.string("f1")])) return StubResponse(status: 201, body: Data(#"{"requestId":"request","entryId":"trip:4"}"#.utf8)) }) { client in try await client.sendGroupMessage( - "trip", content: "Route attached", requestID: "request", replyTo: "trip:3", - attachments: [.init(name: "map.png", mimeType: "image/png", data: "AQI=")]) + "trip", content: "Route attached", requestID: "request", replyTo: "trip:3", files: ["f1"]) } #expect(requests.withLock { $0 } == 1) } diff --git a/apfelkern/Tests/apfelkernTests/AutomationBoardTests.swift b/apfelkern/Tests/apfelkernTests/AutomationBoardTests.swift index 9c004b7..d1d3ad7 100644 --- a/apfelkern/Tests/apfelkernTests/AutomationBoardTests.swift +++ b/apfelkern/Tests/apfelkernTests/AutomationBoardTests.swift @@ -6,14 +6,16 @@ import Testing private func wire( _ id: String, name: String = "Automation", prompt: String = "Say hi", kind: String = "prompt", command: String? = nil, timeout: Int = 600, notify: Bool = true, cron: String? = nil, runAt: String? = nil, - source: String? = nil, enabled: Bool = true, next: String? = nil + source: String? = nil, enabled: Bool = true, next: String? = nil, described: String = "" ) -> String { let text = { (value: String?) in value.map { #""\#($0)""# } ?? "null" } return #""" {"id":"\#(id)","agentId":"a1","name":"\#(name)","prompt":"\#(prompt)","kind":"\#(kind)", "command":\#(text(command)),"timeoutSeconds":\#(timeout),"notify":\#(notify),"cron":\#(text(cron)), "timezone":"Europe/Berlin","runAt":\#(text(runAt)),"eventSourceId":\#(text(source)), - "enabled":\#(enabled),"nextRunAt":\#(text(next)),"createdAt":"2026-11-05T10:00:00.000Z", + "enabled":\#(enabled),"nextRunAt":\#(text(next)),"nextRunLabel":"soon", + "description":"\#(described)","timing":"\#(described)", + "createdAt":"2026-11-05T10:00:00.000Z", "createdByAgentId":null} """# } @@ -30,7 +32,7 @@ private func wait(_ done: () -> Bool) async throws { private let script = wire( "s1", name: "Backup", prompt: "", kind: "script", command: "./backup.sh", timeout: 90, notify: false, - cron: "0 3 * * *", next: "2026-11-07T02:00:00.000Z") + cron: "0 3 * * *", next: "2026-11-07T02:00:00.000Z", described: "Daily at 03:00") private let event = wire("s1", name: "Issues", prompt: "Triage it", source: "src1") /// Opens the one listed automation and saves it unchanged, returning what was sent. @@ -95,6 +97,8 @@ private func savedUnchanged(_ schedule: String) async throws -> JSONValue { try await wait { board.isLoaded } board.setEnabled(board.schedules[0], false, client: client) #expect(board.schedules[0].enabled == false) + #expect(board.schedules[0].timing == "Paused · Daily at 03:00") + #expect(board.schedules[0].nextRunLabel == "—") try await wait { !sent.withLock { $0.isEmpty } } }) let first = sent.withLock { $0.first } @@ -186,6 +190,9 @@ private func savedUnchanged(_ schedule: String) async throws -> JSONValue { @Test func aCreateOnlySendsOneTrigger() async throws { let sent = Mutex<[JSONValue]>([]) try await withClient(handler: { request in + if request.url?.path.hasSuffix("/schedules/preview") == true { + return json(#"{"description":"","text":"Choose an event source.","isProblem":true,"nextRunAt":null}"#) + } if request.httpMethod == "POST" { try sent.withLock { $0.append(try requestJSON(request)) } return json(wire("new", source: "src1"), status: 201) @@ -197,8 +204,10 @@ private func savedUnchanged(_ schedule: String) async throws -> JSONValue { board.draft?.name = "Issues" board.draft?.prompt = "Triage" board.draft?.onEvent = true + await board.loadPreview(client: client, after: .zero) board.saveDraft(client: client) #expect(board.saveError == "Choose an event source.") + #expect(sent.withLock { $0.isEmpty }) board.draft?.eventSourceId = "src1" board.saveDraft(client: client) try await wait { !sent.withLock { $0.isEmpty } } @@ -276,25 +285,6 @@ private func savedUnchanged(_ schedule: String) async throws -> JSONValue { #expect(Schedule(id: "6", agentId: "a", name: "e", prompt: "p", eventSourceId: "s", enabled: true).status == .active) } -@Test func nextRunReadsInWordsNearbyAndADashWhenPaused() { - let now = Date(timeIntervalSince1970: 1_800_000_000) - let schedule = { (seconds: TimeInterval, enabled: Bool) in - Schedule( - id: "s", agentId: "a", name: "n", cron: "* * * * *", prompt: "p", enabled: enabled, - nextRunAt: now.addingTimeInterval(seconds).ISO8601Format()) - } - #expect(nextRunLabel(schedule(300, true), now: now) == "in 5 minutes") - #expect(nextRunLabel(schedule(7200, true), now: now) == "in 2 hours") - #expect(nextRunLabel(schedule(300, false), now: now) == "—") -} - -@Test func timingNamesEventSourcesAndPausedAutomations() { - let event = Schedule(id: "s", agentId: "a", name: "n", prompt: "p", eventSourceId: "src", enabled: false) - #expect(cadence(event) == "On event") - #expect(cadence(event, sources: [EventSource(id: "src", name: "Issues")]) == "On event · Issues") - #expect(automationTiming(event) == "Paused · On event") -} - @Test func theBuilderReadsAndWritesEachCronShape() throws { for cron in ["5 * * * *", "30 8 * * *", "0 9 * * 1-5", "0 9 * * 1,3", "15 7 12 * *"] { #expect(Recurrence(cron: cron)?.cron == cron) @@ -332,51 +322,6 @@ private func savedUnchanged(_ schedule: String) async throws -> JSONValue { #expect(recurrence.days == [3]) } -private let berlin = TimeZone(identifier: "Europe/Berlin") ?? .gmt - -private func instant(_ text: String) throws -> Date { try #require(automationRunDate(text)) } - -@Test func cronFindsTheNextRunInItsZone() throws { - let from = try instant("2026-11-06T10:30:00Z") - #expect(CronExpression("0 9 * * *")?.next(after: from, in: berlin) == (try instant("2026-11-07T08:00:00Z"))) - #expect(CronExpression("*/15 * * * *")?.next(after: from, in: berlin) == (try instant("2026-11-06T10:45:00Z"))) - #expect(CronExpression("0 9 * * MON-FRI")?.next(after: from, in: berlin) == (try instant("2026-11-09T08:00:00Z"))) - #expect(CronExpression("0 0 1 JAN *")?.next(after: from, in: berlin) == (try instant("2026-12-31T23:00:00Z"))) - #expect(CronExpression("0 0 29 2 *")?.next(after: from, in: berlin) == (try instant("2028-02-28T23:00:00Z"))) - // Both set means either: the 15th, or the Monday that comes first. - #expect(CronExpression("0 12 15 * 1")?.next(after: from, in: berlin) == (try instant("2026-11-09T11:00:00Z"))) -} - -@Test func cronSkipsATimeTheClockChangeRemoves() throws { - let from = try instant("2027-03-27T12:00:00Z") - #expect(CronExpression("30 2 * * *")?.next(after: from, in: berlin) == (try instant("2027-03-29T00:30:00Z"))) -} - -@Test func cronSaysWhenItCantTell() throws { - #expect(CronExpression("0 0 L * *") == nil) - #expect(CronExpression("@daily") == nil) - #expect(CronExpression("not a cron") == nil) - #expect(CronExpression("0 0 31 2 *")?.next(after: .now, in: berlin) == nil) -} - -@Test func thePreviewSaysWhatTheScheduleWillDo() throws { - let now = try instant("2026-11-06T10:30:00Z") - var draft = AutomationDraft(agentID: "a") - draft.timezone = "Europe/Berlin" - draft.when = .daily - #expect(draft.preview(now: now)?.text.hasPrefix("Next run tomorrow at ") == true) - #expect(draft.preview(now: now)?.text.hasSuffix("(Europe/Berlin)") == true) - draft.cron = "0 0 31 2 *" - #expect(draft.preview(now: now) == AutomationPreview(text: "This schedule never runs.", isProblem: true)) - draft.cron = "0 0 L * *" - #expect(draft.preview(now: now)?.isProblem == false) - draft.when = .once - draft.runDate = now.addingTimeInterval(-60) - #expect(draft.preview(now: now) == AutomationPreview(text: "This time has passed.", isProblem: true)) - draft.onEvent = true - #expect(draft.preview(now: now) == nil) -} - @Test func aDraftExplainsWhatStopsItSaving() { var draft = AutomationDraft(agentID: "a") #expect(draft.problem == "Automation name and prompt are required.") @@ -388,10 +333,6 @@ private func instant(_ text: String) throws -> Date { try #require(automationRun #expect(draft.problem == "Timeout must be between 1 and 3600 seconds.") draft.timeoutSeconds = "90" #expect(draft.problem == nil) - draft.timezone = "Not/AZone" - #expect(draft.problem == "Choose a valid time zone.") - draft.onEvent = true - #expect(draft.problem == "Choose an event source.") } @Test func aPickerShowsASavedRunAtItsOwnInstant() throws { @@ -399,7 +340,7 @@ private func instant(_ text: String) throws -> Date { try #require(automationRun id: "s", agentId: "a", name: "n", prompt: "p", timezone: "Europe/Berlin", runAt: "2026-10-18T10:10:00Z", enabled: true) let draft = try #require(AutomationDraft(schedule: schedule)) - #expect(draft.runDate == (try instant("2026-10-18T10:10:00Z"))) + #expect(draft.runDate == (try #require(automationRunDate("2026-10-18T10:10:00Z")))) #expect(!draft.repeats) guard case .string(let runAt)? = draft.payload["runAt"] else { throw CancellationError() } #expect(automationRunDate(runAt) == draft.runDate) @@ -450,3 +391,165 @@ private func instant(_ text: String) throws -> Date { try #require(automationRun #expect(board.schedules(on: "other").isEmpty) }) } + +@MainActor +@Test(arguments: [false, true]) +func aPastTriggerPreviewOnlyBlocksChangedTriggers(changeTrigger: Bool) async throws { + let original = wire( + "s1", name: "Backup", prompt: "", kind: "script", command: "./backup.sh", + runAt: "2020-01-01T10:00:00.123Z") + let renamed = original.replacingOccurrences(of: "Backup", with: "Renamed") + let sent = Mutex<[JSONValue]>([]) + try await withClient(handler: { request in + if request.url?.path.hasSuffix("/schedules/preview") == true { + return json(#"{"description":"Once","text":"This time has passed.","isProblem":true,"nextRunAt":null}"#) + } + if request.httpMethod == "PATCH" { + try sent.withLock { $0.append(try requestJSON(request)) } + return json(renamed) + } + return json("[\(sent.withLock { $0.isEmpty } ? original : renamed)]") + }, test: { client in + let board = AutomationBoard() + board.refresh(client: client) + try await wait { board.isLoaded } + board.edit(board.schedules[0]) + board.draft?.name = "Renamed" + if changeTrigger { board.draft?.runDate.addTimeInterval(60) } + await board.loadPreview(client: client, after: .zero) + #expect(board.draftPreview?.isProblem == true) + #expect((board.draftPreviewProblem != nil) == changeTrigger) + board.saveDraft(client: client) + if changeTrigger { + #expect(board.saveError == "This time has passed.") + #expect(board.draft?.name == "Renamed") + #expect(sent.withLock { $0.isEmpty }) + } else { + #expect(board.saveError.isEmpty) + #expect(board.draft == nil) + try await wait { !sent.withLock { $0.isEmpty } && !board.isPending("s1") } + #expect(sent.withLock { $0.first?["name"] } == .string("Renamed")) + #expect(sent.withLock { $0.first?["runAt"] } == .string("2020-01-01T10:00:00.123Z")) + #expect(board.schedules.first?.name == "Renamed") + #expect(board.schedules.first?.nextRunAt == nil) + } + }) +} + +private let preview = #"{"description":"At 09:00 (Europe/Berlin)","text":"Next run tomorrow at 09:00","# + + #""isProblem":false,"nextRunAt":"2026-11-07T08:00:00.000Z"}"# + +@MainActor +@Test func thePreviewAsksAboutTheCurrentTriggerAndDropsStaleAnswers() async throws { + let asked = Mutex<[JSONValue]>([]) + try await withClient(handler: { request in + let body = try requestJSON(request) + asked.withLock { $0.append(body) } + return json(preview, delay: body["cron"] == .string("0 8 * * *") ? 0.05 : 0) + }, test: { client in + let board = AutomationBoard() + board.openNew(agentID: "a1") + board.draft?.timezone = "Europe/Berlin" + board.draft?.when = .daily + board.draft?.cron = "0 8 * * *" + let late = Task { await board.loadPreview(client: client, after: .zero) } + try await wait { asked.withLock { $0.count } == 1 } + board.draft?.cron = "0 9 * * *" + await late.value + #expect(board.draftPreview == nil) + + await board.loadPreview(client: client, after: .zero) + #expect(board.draftPreview?.text == "Next run tomorrow at 09:00") + #expect(asked.withLock { $0.last } == .object([ + "cron": .string("0 9 * * *"), "timezone": .string("Europe/Berlin") + ])) + board.draft?.when = .once + #expect(board.draftPreview == nil) + + // An answer that lands after the connection changed is dropped too. + board.draft?.when = .daily + board.draft?.cron = "0 8 * * *" + let dropped = Task { await board.loadPreview(client: client, after: .zero) } + try await wait { asked.withLock { $0.count } == 3 } + board.reset() + await dropped.value + #expect(board.draftPreview == nil) + }) +} + +@MainActor +@Test func aPreviewWaitsForTheTriggerToSettle() async throws { + let asked = Mutex(0) + try await withClient(handler: { _ in + asked.withLock { $0 += 1 } + return json(preview) + }, test: { client in + let board = AutomationBoard() + board.openNew(agentID: "a1") + let typing = Task { await board.loadPreview(client: client, after: .milliseconds(50)) } + typing.cancel() + await typing.value + try await Task.sleep(for: .milliseconds(80)) + #expect(asked.withLock { $0 } == 0) + #expect(board.draftPreview == nil) + }) +} + +@MainActor +@Test func aFailedPreviewShowsNothingAndTheSaveStillGoes() async throws { + let created = Mutex(false) + try await withClient(handler: { request in + if request.url?.path.hasSuffix("/schedules/preview") == true { return json(#"{"error":"down"}"#, status: 503) } + if request.httpMethod == "POST" { + created.withLock { $0 = true } + return json(wire("new", name: "Morning", cron: "0 9 * * *"), status: 201, delay: 0.05) + } + return json("[]") + }, test: { client in + let board = AutomationBoard() + board.openNew(agentID: "a1") + board.draft?.name = "Morning" + board.draft?.prompt = "Say hi" + board.draft?.when = .daily + await board.loadPreview(client: client, after: .zero) + #expect(board.draftPreview == nil) + board.saveDraft(client: client) + #expect(board.saveError.isEmpty) + #expect(board.schedules.first?.nextRunLabel == "Saving…") + #expect(board.schedules.first?.description == "Saving…") + try await wait { created.withLock { $0 } && board.isLoaded } + }) +} + +@MainActor +@Test func aSavedRowRunsWhenThePreviewSaid() async throws { + try await withClient(handler: { request in + request.url?.path.hasSuffix("/schedules/preview") == true + ? json(preview) : json(wire("new", cron: "0 9 * * *"), status: 201, delay: 0.05) + }, test: { client in + let board = AutomationBoard() + board.openNew(agentID: "a1") + board.draft?.name = "Morning" + board.draft?.prompt = "Say hi" + board.draft?.when = .daily + await board.loadPreview(client: client, after: .zero) + board.saveDraft(client: client) + #expect(board.schedules.first?.nextRunAt == "2026-11-07T08:00:00.000Z") + }) +} + +@MainActor +@Test func theListRefreshesItsLabelsWhileItIsShown() async throws { + let reads = Mutex(0) + try await withClient(handler: { _ in + reads.withLock { $0 += 1 } + return json("[\(script)]") + }, test: { client in + let board = AutomationBoard() + let following = Task { await board.follow(client: client, every: .milliseconds(10)) } + try await wait { reads.withLock { $0 } >= 2 } + #expect(board.schedules.first?.nextRunLabel == "soon") + following.cancel() + await following.value + }) +} diff --git a/apfelkern/Tests/apfelkernTests/BotChatDeliveryTests.swift b/apfelkern/Tests/apfelkernTests/BotChatDeliveryTests.swift index e4d4911..7b07ad2 100644 --- a/apfelkern/Tests/apfelkernTests/BotChatDeliveryTests.swift +++ b/apfelkern/Tests/apfelkernTests/BotChatDeliveryTests.swift @@ -16,7 +16,7 @@ struct BotChatDeliveryTests { #expect(row.deliveryState == .sending) #expect(row.replyTo == "a1:4") #expect(row.replyPreview == "earlier") - #expect(row.attachments == [AttachmentInfo(name: "dot.png", mimeType: "image/png", size: 3, kind: "image")]) + #expect(row.attachments == [AttachmentInfo(name: "dot.png", mimeType: "image/png", size: 3)]) #expect(delivery.preview(botID: "a1") == "hello") #expect(delivery.imageData(botID: "a1", requestID: "request", index: 0) == image.data) #expect(delivery.imageData(botID: "a1", requestID: "request", index: 1) == nil) @@ -95,4 +95,45 @@ struct BotChatDeliveryTests { #expect(!lateFailure) } } + + @Test func uploadsStayWithTheirSendUntilTheServerRejectsAFile() { + var delivery = BotChatDelivery() + let file = PendingAttachment(name: "notes.txt", mimeType: "text/plain", data: Data("notes".utf8)) + let send = BotChatDelivery.Send(content: "read", replyTo: "", attachments: [file]) + _ = delivery.stage(send, botID: "a1", requestID: "request") + _ = delivery.stage(send, botID: "group:trip", requestID: "other") + let recorded = delivery.recordUpload("f1", for: file.id, botID: "a1", requestID: "request") + #expect(recorded) + #expect(delivery.uploadedFile(file.id, botID: "a1", requestID: "request") == "f1") + #expect(delivery.uploadedFile(file.id, botID: "group:trip", requestID: "other") == nil) + + let busy = APIError(method: "POST", path: "/v1/agents/a1/messages", statusCode: 503, body: #"{"error":"busy"}"#) + _ = delivery.fail(botID: "a1", requestID: "request", error: busy) + #expect(delivery.uploadedFile(file.id, botID: "a1", requestID: "request") == "f1") + + let deleted = APIError( + method: "POST", path: "/v1/agents/a1/messages", statusCode: 400, + body: #"{"error":"notes.txt was deleted from the library"}"#) + _ = delivery.beginRetry(botID: "a1", requestID: "request") + _ = delivery.fail(botID: "a1", requestID: "request", error: deleted) + #expect(delivery.uploadedFile(file.id, botID: "a1", requestID: "request") == nil) + #expect(delivery.beginRetry(botID: "a1", requestID: "request")?.attachments.first?.data == file.data) + + delivery.reset() + let late = delivery.recordUpload("f2", for: file.id, botID: "a1", requestID: "request") + #expect(!late) + #expect(!delivery.isPending(botID: "a1", requestID: "request")) + } + + @Test func missingLibraryFilesAlsoDropUploads() { + var delivery = BotChatDelivery() + let file = PendingAttachment(name: "a.png", mimeType: "image/png", data: Data([1])) + _ = delivery.stage(.init(content: "", replyTo: "", attachments: [file]), botID: "a1", requestID: "request") + _ = delivery.recordUpload("f1", for: file.id, botID: "a1", requestID: "request") + let missing = APIError( + method: "POST", path: "/v1/agents/a1/messages", statusCode: 400, + body: #"{"error":"File not found in this library"}"#) + _ = delivery.fail(botID: "a1", requestID: "request", error: missing) + #expect(delivery.uploadedFile(file.id, botID: "a1", requestID: "request") == nil) + } } diff --git a/apfelkern/Tests/apfelkernTests/BotRequestBoardTests.swift b/apfelkern/Tests/apfelkernTests/BotRequestBoardTests.swift index 3b0964c..3239f7a 100644 --- a/apfelkern/Tests/apfelkernTests/BotRequestBoardTests.swift +++ b/apfelkern/Tests/apfelkernTests/BotRequestBoardTests.swift @@ -135,7 +135,9 @@ private func showing(_ request: BotRequest, client: APIClient) async throws -> B #expect(board.current(request).status == .pending) board.refreshIfChanged(messages: [try toolResult()], client: client) #expect(board.needsPolling) + #expect(!board.isLoaded(request.id)) try await wait { board.current(request).status == .declined } + #expect(board.isLoaded(request.id)) #expect(!board.needsPolling) try await stop(board) }) diff --git a/apfelkern/Tests/apfelkernTests/BotSecretBoardTests.swift b/apfelkern/Tests/apfelkernTests/BotSecretBoardTests.swift index c195959..3d5ee08 100644 --- a/apfelkern/Tests/apfelkernTests/BotSecretBoardTests.swift +++ b/apfelkern/Tests/apfelkernTests/BotSecretBoardTests.swift @@ -172,10 +172,12 @@ private func field(_ value: JSONValue?, _ key: String) -> JSONValue? { board.select("a1") let asked = try #require(BotSecretAsk(message: ask())) #expect(board.state(of: asked) == .outcome("Loading…")) + #expect(!board.isReady(asked)) board.refreshIfChanged(messages: [ask()], client: client) #expect(board.needsPolling) try await wait { board.state(of: asked) != .outcome("Loading…") } guard case .waiting(let waiting) = board.state(of: asked) else { throw URLError(.badServerResponse) } + #expect(board.isReady(asked)) board.add(waiting, kind: .credential, agentID: "a1", client: client) #expect(board.draft?.nameLocked == true) @@ -185,6 +187,7 @@ private func field(_ value: JSONValue?, _ key: String) -> JSONValue? { board.saveDraft(client: client) #expect(board.draft == nil) #expect(board.state(of: asked) == .outcome("Saved")) + #expect(board.isReady(asked)) #expect(!board.needsPolling) try await stop(board) }) @@ -199,6 +202,7 @@ private func field(_ value: JSONValue?, _ key: String) -> JSONValue? { let asked = try #require(BotSecretAsk(message: later)) try await wait { board.state(of: asked) != .outcome("Loading…") } #expect(board.state(of: asked) == .outcome("Declined")) + #expect(board.isReady(asked)) try await stop(board) }) } @@ -210,6 +214,7 @@ private func field(_ value: JSONValue?, _ key: String) -> JSONValue? { board.refreshIfChanged(messages: [ask()], client: client) let asked = try #require(BotSecretAsk(message: ask())) try await wait { board.state(of: asked) == .outcome("Unavailable") } + #expect(!board.isReady(asked)) #expect(board.needsPolling) #expect(board.readError(.credential, agentID: "a1") == "Down") try await stop(board) diff --git a/apfelkern/Tests/apfelkernTests/CallRequestTests.swift b/apfelkern/Tests/apfelkernTests/CallRequestTests.swift index e5442f2..1562646 100644 --- a/apfelkern/Tests/apfelkernTests/CallRequestTests.swift +++ b/apfelkern/Tests/apfelkernTests/CallRequestTests.swift @@ -164,8 +164,8 @@ func aRequestNamesItsState(status: CallRequest.Status, outcome: CallRequest.Outc } @Test func theTranscriptKeepsWhatWasSaid() { - let blocks = JSONValue.array([.object(["type": .string("text"), "text": .string("Hi")])]) - let silent = JSONValue.array([.object(["type": .string("toolCall")])]) + let blocks: [TranscriptBlock] = [.text(.init(text: "Hi", _type: .text))] + let silent: [TranscriptBlock] = [.toolCall(.init(arguments: .init(), id: "c", name: "bash", _type: .toolCall))] let lines = callTranscriptLines([ Message(id: "1", role: "user", content: .string("Hello?")), Message(id: "2", role: "assistant", content: .string("Hi"), blocks: blocks), @@ -182,8 +182,9 @@ func aRequestNamesItsState(status: CallRequest.Status, outcome: CallRequest.Outc @Test func theTranscriptComesFromItsEndpoint() async throws { try await withClient(handler: { request in #expect(request.url?.path == "/prefix/v1/agents/a1/call-requests/r1/transcript") - return StubResponse(body: Data( - #"{"messages":[{"id":"m1","entryId":"e1","role":"user","content":"Hello?"}],"hasMore":false}"#.utf8)) + return StubResponse(body: Data(( + #"{"messages":[{"id":"m1","entryId":"e1","role":"user","content":"Hello?","replyReferences":[]}],"# + + #""hasMore":false}"#).utf8)) }, test: { client in let page = try await client.callRequestTranscript("a1", id: "r1") #expect(page.messages?.map(\.id) == ["m1"]) @@ -199,7 +200,9 @@ func aRequestNamesItsState(status: CallRequest.Status, outcome: CallRequest.Outc #expect(board.current(request).status == .pending) board.refreshIfChanged(messages: [try toolResult()], client: client) #expect(board.needsPolling) + #expect(!board.isLoaded(request.id)) try await wait { board.current(request).status == .calling } + #expect(board.isLoaded(request.id)) #expect(board.needsPolling) try await stop(board) }) diff --git a/apfelkern/Tests/apfelkernTests/ChatAttentionTests.swift b/apfelkern/Tests/apfelkernTests/ChatAttentionTests.swift new file mode 100644 index 0000000..d2f53ca --- /dev/null +++ b/apfelkern/Tests/apfelkernTests/ChatAttentionTests.swift @@ -0,0 +1,306 @@ +import CoreGraphics +import Foundation +import Synchronization +import Testing +@testable import apfelkern + +/// A request to the chat-attention API, as the stub server received it. +private struct Sent: Sendable { + var method: String + var path: String + var token: String + var body: JSONValue + + init(_ request: URLRequest) { + method = request.httpMethod ?? "" + path = request.url?.path ?? "" + token = request.value(forHTTPHeaderField: "Authorization") ?? "" + body = (try? requestJSON(request)) ?? .null + } + + var view: String { path.components(separatedBy: "/").last ?? "" } + var chat: JSONValue? { if case .object(let fields) = body { fields["chat"] } else { nil } } + var chatID: String? { + if case .object(let chat)? = chat, case .string(let id)? = chat["id"] { id } else { nil } + } + var kind: String? { + if case .object(let chat)? = chat, case .string(let kind)? = chat["kind"] { kind } else { nil } + } + var eventIDs: [String] { + guard case .object(let fields) = body, case .array(let ids)? = fields["eventIds"] else { return [] } + return ids.compactMap { if case .string(let id) = $0 { id } else { nil } } + } +} + +private let noContent = StubResponse(status: 204, body: Data()) + +private func failure(_ status: Int) -> StubResponse { + StubResponse(status: status, body: Data(#"{"error":"no"}"#.utf8)) +} + +private final class AttentionServer: Sendable { + private let sent = Mutex<[Sent]>([]) + private let reply = Mutex<@Sendable (Sent) -> StubResponse>({ _ in noContent }) + + var handler: ContractURLProtocol.Handler { + { [self] request in + let request = Sent(request) + sent.withLock { $0.append(request) } + return reply.withLock { $0 }(request) + } + } + + func respond(_ reply: @escaping @Sendable (Sent) -> StubResponse) { + self.reply.withLock { $0 = reply } + } + + var all: [Sent] { sent.withLock { $0 } } + var presence: [Sent] { all.filter { $0.method == "PUT" } } + var seen: [Sent] { all.filter { $0.method == "POST" } } +} + +private let timing = ChatAttention.Timing( + heartbeat: .milliseconds(250), batchDelay: .milliseconds(10), retry: .milliseconds(20), + maxRetry: .milliseconds(40), clearTimeout: .milliseconds(300)) +private let bot = ChatAttentionChat.bot("a1") +private let group = ChatAttentionChat.group("g1") + +@MainActor +private func eventually(_ done: () -> Bool) async throws { + for _ in 0..<300 where !done() { try await Task.sleep(for: .milliseconds(10)) } + #expect(done()) +} + +/// Lets anything still due land, for checks that nothing more was sent. +private func pause(_ milliseconds: Int = 120) async throws { + try await Task.sleep(for: .milliseconds(milliseconds)) +} + +extension ChatAttention { + /// A surface that's ready and inside a 100-point viewport. + fileprivate func show(_ eventIDs: [String], in chat: ChatAttentionChat, key: String = "s") { + setSurface( + key, of: chat, frame: CGRect(x: 0, y: 10, width: 50, height: 20), container: CGSize(width: 100, height: 100), + eventIDs: eventIDs, ready: true) + } +} + +private func other(_ client: APIClient, token: String) -> APIClient { + APIClient(baseURL: client.baseURL, token: token, session: client.session) +} + +@MainActor @Test func presenceNeedsAnActiveRouteAndItsMountedChatButNoPushRegistration() async throws { + let server = AttentionServer() + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(group) + try await pause(60) + #expect(server.all.isEmpty) + + attention.mount(bot) + try await eventually { server.presence.count == 1 } + #expect(server.presence[0].body == .object(["chat": .object(["kind": .string("bot"), "id": .string("a1")])])) + #expect(server.presence[0].path == "/prefix/v1/chat-attention/views/\(attention.viewID)") + + attention.update(client: client, active: false, route: bot) + try await eventually { server.presence.count == 2 } + #expect(server.presence[1].body == .object(["chat": .null])) + + attention.update(client: client, active: true, route: group) + attention.mount(group) + try await eventually { server.presence.last?.kind == "group" } + #expect(server.presence.last?.chatID == "g1") + + attention.update(client: other(client, token: " "), active: true, route: group) + try await eventually { server.presence.last?.chat == .null } + try await pause() + #expect(server.all.allSatisfy { $0.path.hasPrefix("/prefix/v1/chat-attention/views/") }) + }) +} + +@MainActor @Test func aRefreshInFlightCollapsesBehindTheClearAndTheHeartbeatStopsWithIt() async throws { + let server = AttentionServer() + server.respond { $0.chat == .null ? noContent : StubResponse(status: 204, body: Data(), delay: 0.8) } + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + try await eventually { server.presence.count == 1 } + // The heartbeat comes due while the first report is still in flight. + try await pause(350) + attention.update(client: client, active: false, route: bot) + try await eventually { server.presence.count == 2 } + #expect(server.presence[1].chat == .null) + try await pause(600) + #expect(server.presence.count == 2) + + server.respond { _ in noContent } + attention.update(client: client, active: true, route: bot) + try await eventually { server.presence.count == 3 } + try await eventually { server.presence.count == 4 } + #expect(server.presence.dropFirst(2).allSatisfy { $0.chatID == "a1" }) + }) +} + +@MainActor @Test func aNewAccountGetsANewViewAndTheOldOneClearsThroughTheOldSession() async throws { + let server = AttentionServer() + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + try await eventually { server.presence.count == 1 } + let first = attention.viewID + + attention.update(client: other(client, token: "next"), active: true, route: bot) + #expect(attention.viewID != first) + try await eventually { server.presence.filter { $0.view == first }.count == 2 } + let old = server.presence.filter { $0.view == first } + #expect(old.map(\.chat) == [server.presence[0].chat, .null]) + #expect(old.allSatisfy { $0.token == "Bearer test-token" }) + let next = try #require(server.presence.last { $0.view == attention.viewID }) + #expect(next.token == "Bearer next") + #expect(next.chatID == "a1") + }) +} + +@MainActor @Test func seenRepliesGoInBatchesOf100AndRetryInTheirOwnChatAfterNavigation() async throws { + let server = AttentionServer() + let failures = Mutex(1) + server.respond { request in + guard request.method == "POST" else { return noContent } + return failures.withLock { left in + defer { left -= 1 } + return left > 0 ? failure(503) : noContent + } + } + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + let ids = (1...205).map { "e\($0)" } + attention.show(ids + ids, in: bot) + try await eventually { server.seen.count == 1 } + #expect(server.seen[0].eventIDs.count == 100) + + attention.update(client: client, active: true, route: group) + attention.mount(group) + try await eventually { server.seen.count == 4 } + #expect(server.seen.map(\.eventIDs.count) == [100, 100, 100, 5]) + #expect(server.seen.allSatisfy { $0.kind == "bot" && $0.chatID == "a1" }) + #expect(server.seen.dropFirst().flatMap(\.eventIDs) == ids) + + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + attention.show(ids, in: bot, key: "again") + try await pause() + #expect(server.seen.count == 4) + }) +} + +@MainActor @Test(arguments: [400, 404]) +func aRefusedBatchIsSplitAndOnlyItsRefusedEventsAreDropped(status: Int) async throws { + let server = AttentionServer() + server.respond { $0.method == "POST" && $0.eventIDs.contains("bad") ? failure(status) : noContent } + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + attention.show(["good", "bad", "also-good"], in: bot) + try await eventually { server.seen.count == 4 } + #expect(server.seen.map(\.eventIDs) == [["good", "bad", "also-good"], ["good"], ["bad"], ["also-good"]]) + try await pause() + #expect(server.seen.count == 4) + }) +} + +@MainActor @Test func anEndedSessionStopsSeenRetries() async throws { + let server = AttentionServer() + server.respond { $0.method == "POST" ? failure(401) : noContent } + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + attention.show(["e1"], in: bot) + try await eventually { server.seen.count == 1 } + attention.show(["e2"], in: bot, key: "later") + try await pause() + #expect(server.seen.count == 1) + }) +} + +@MainActor @Test func onlyAReadySurfaceInTheUncoveredViewportOfTheShownChatCounts() async throws { + let server = AttentionServer() + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + let container = CGSize(width: 100, height: 100) + let inside = CGRect(x: 0, y: 40, width: 50, height: 20) + attention.update(client: client, active: true, route: bot) + attention.setSurface("early", of: bot, frame: inside, container: container, eventIDs: ["early"], ready: true) + try await pause(60) + #expect(server.seen.isEmpty) + + attention.mount(bot) + try await eventually { server.seen.count == 1 } + #expect(server.seen[0].eventIDs == ["early"]) + + attention.setViewportInsets(top: 0, bottom: 30) + attention.setSurface("loading", of: bot, frame: inside, container: container, eventIDs: ["card"], ready: false) + let below = CGRect(x: 0, y: 100, width: 50, height: 20) + attention.setSurface("below", of: bot, frame: below, container: container, eventIDs: ["below"], ready: true) + let covered = CGRect(x: 0, y: 75, width: 50, height: 20) + attention.setSurface("covered", of: bot, frame: covered, container: container, eventIDs: ["covered"], ready: true) + attention.setSurface("other", of: group, frame: inside, container: container, eventIDs: ["other"], ready: true) + attention.update(client: client, active: false, route: bot) + attention.setSurface("away", of: bot, frame: inside, container: container, eventIDs: ["away"], ready: true) + try await pause() + #expect(server.seen.count == 1) + + // Coming back to the app shows what is already on screen, though nothing moved. + attention.update(client: client, active: true, route: bot) + try await eventually { server.seen.count == 2 } + #expect(server.seen[1].eventIDs == ["away"]) + attention.setSurface("loading", of: bot, frame: inside, container: container, eventIDs: ["card"], ready: true) + try await eventually { server.seen.count == 3 } + #expect(server.seen[2].eventIDs == ["card"]) + }) +} + +@MainActor @Test func signingOutClearsThroughTheOldSessionWithinTheTimeoutAndRefusesItAfterwards() async throws { + let server = AttentionServer() + server.respond { request in + if request.method == "POST" { return failure(503) } + return request.chat == .null ? StubResponse(status: 204, body: Data(), hold: true) : noContent + } + try await withClient(handler: server.handler, test: { client in + let attention = ChatAttention(timing: timing) + attention.update(client: client, active: true, route: bot) + attention.mount(bot) + attention.show(["e1"], in: bot) + try await eventually { server.presence.count == 1 && !server.seen.isEmpty } + let old = attention.viewID + + let started = ContinuousClock.now + let closing = Task { await attention.disconnect(client) } + await Task.yield() + #expect(attention.viewID != old) + attention.update(client: client, active: true, route: bot) + attention.show(["late"], in: bot, key: "late") + await closing.value + let waited = ContinuousClock.now - started + #expect(waited >= .milliseconds(250) && waited < .seconds(2)) + #expect(server.presence.count == 2) + #expect(server.presence[1].view == old && server.presence[1].chat == .null) + let seen = server.seen.count + attention.update(client: nil, active: false, route: nil) + attention.update(client: client, active: true, route: bot) + try await pause() + #expect(server.presence.count == 2) + #expect(server.seen.count == seen) + + server.respond { _ in noContent } + attention.update(client: other(client, token: "next"), active: true, route: bot) + try await eventually { server.presence.last?.token == "Bearer next" } + #expect(server.presence.last?.chatID == "a1") + }) +} diff --git a/apfelkern/Tests/apfelkernTests/ChatCardsTests.swift b/apfelkern/Tests/apfelkernTests/ChatCardsTests.swift index dae80cf..b2ff149 100644 --- a/apfelkern/Tests/apfelkernTests/ChatCardsTests.swift +++ b/apfelkern/Tests/apfelkernTests/ChatCardsTests.swift @@ -61,7 +61,7 @@ struct ChatCardsTests { @Test func theWireOriginCarriesGatewayAndSource() throws { let wire = """ - {"id": "1", "entryId": "e", "role": "user", "content": "hi", + {"id": "1", "entryId": "e", "role": "user", "content": "hi", "replyReferences": [], "origin": {"kind": "owner", "via": "discord", "source": "GitHub"}} """ let message = try Message( @@ -70,39 +70,29 @@ struct ChatCardsTests { #expect(message.origin?.source == "GitHub") } - private func call(_ names: String...) -> Message { - let blocks = names.map { JSONValue.object(["type": .string("toolCall"), "name": .string($0)]) } - return Message(id: "c", role: "assistant", blocks: .array(blocks)) - } - - @Test func workingReadsTheTurn() { - let running = ChatSnapshot(status: "running") - let cases: [(Message?, Working)] = [ - (nil, .thinking), - (Message(id: "u", role: "user"), .thinking), - (call("web_search", "memory"), .searching), - (call("history_read"), .searching), - (call("memory"), .remembering), - (call("bash"), .tinkering), - (Message(id: "t", role: "toolResult", isError: true), .struggling), - (Message(id: "t", role: "toolResult"), .thinking) - ] - for (last, working) in cases { - #expect(Working(snapshot: running, messages: last.map { [$0] } ?? []) == working) - } - } - - @Test func workingIgnoresTheOwnersPendingMessage() { - let pending = Message(id: "p", role: "user", deliveryState: .sending) - #expect(Working(snapshot: ChatSnapshot(status: "running"), messages: [call("memory"), pending]) == .remembering) - } - - @Test func workingFollowsTheStatus() { - #expect(Working(snapshot: nil, messages: []) == .idle) - #expect(Working(snapshot: ChatSnapshot(status: "idle"), messages: []) == .idle) - #expect(Working(snapshot: ChatSnapshot(status: "failed"), messages: []) == .failed) - #expect(Working(snapshot: ChatSnapshot(status: "running", partial: "Hi"), messages: [call("bash")]) == .writing) - #expect(Working(snapshot: ChatSnapshot(status: "running", partial: " \n"), messages: []) == .thinking) + @Test func theServersWorkStateAndPresentationArriveOverHTTPAndTheStream() async throws { + let snapshot = #"{"agentId":"a1","status":"running","working":"searching","partial":"","updatedAt":0,"# + + #""error":null,"hasMore":false,"oldestEntryId":null,"conversationId":"c1","# + + #""conversation":{"id":"c1","agentId":"a1","title":"Chat","createdAt":"now","updatedAt":"now"},"# + + #""messages":[{"id":"a1:1:0","entryId":"a1:1","role":"assistant","content":"Raw","replyReferences":[],"# + + #""blocks":[{"type":"toolCall","id":"c","name":"web_search","arguments":{"query":"x"}}],"# + + #""presentation":{"text":"Clean","citations":[]}}]}"# + let streamed = try JSONDecoder().decode(ChatSnapshot.self, from: Data(snapshot.utf8)) + try await withClient(handler: { _ in StubResponse(body: Data(snapshot.utf8)) }, test: { client in + let fetched = try await client.chat("a1") + for decoded in [streamed, fetched] { + #expect(decoded.working == .searching) + #expect(decoded.isRunning) + #expect(decoded.messages?.first?.presentedText == "Clean") + guard case .toolCall(let call)? = decoded.messages?.first?.blocks?.first else { + Issue.record("The tool call block is missing") + continue + } + #expect(call.name == "web_search") + } + }) + #expect(!ChatSnapshot(status: "failed", working: .failed).isRunning) + #expect(!ChatSnapshot(status: "idle").isRunning) } @Test func workingLabelsMatchTheWeb() { diff --git a/apfelkern/Tests/apfelkernTests/ChatFilesTests.swift b/apfelkern/Tests/apfelkernTests/ChatFilesTests.swift new file mode 100644 index 0000000..c786393 --- /dev/null +++ b/apfelkern/Tests/apfelkernTests/ChatFilesTests.swift @@ -0,0 +1,34 @@ +import Foundation +import Testing +@testable import apfelkern + +struct ChatFilesTests { + @Test func transcriptFilesKeepTheirIDsAndDeletedMarkers() throws { + let wire = try JSONDecoder().decode(Components.Schemas.TranscriptMessage.self, from: Data(#""" + {"id":"a1:5:0","entryId":"a1:5","role":"user","content":"","replyReferences":[], + "files":[{"id":"f1","name":"dot.png","mimeType":"image/png","size":70}, + {"id":"f2","name":"notes.txt","mimeType":"text/plain","size":5}, + {"id":"f3","deleted":true}]} + """#.utf8)) + let files = try Message(wire: wire).attachments ?? [] + #expect(files.map(\.id) == ["f1", "f2", "f3"]) + #expect(files.map(\.isImage) == [true, false, false]) + #expect(files.map(\.deleted) == [false, false, true]) + #expect(files[0] == AttachmentInfo(id: "f1", name: "dot.png", mimeType: "image/png", size: 70)) + } + + @Test func aDeletionReachesEveryReferenceInItsChatOnly() { + let live = AttachmentInfo(id: "f1", name: "dot.png", mimeType: "image/png", size: 1) + let older = Message(id: "a1:1:0", entryId: "a1:1", role: "user", attachments: [live]) + let newer = Message(id: "a1:2:0", entryId: "a1:2", role: "user", attachments: [.deleted("f1")]) + var deleted = DeletedFiles() + let reconciled = deleted.reconcile([older, newer], chat: "a1") + #expect(reconciled.map { $0.attachments?.first?.deleted } == [true, true]) + #expect(reconciled.first?.attachments?.first?.isImage == false) + // A page loaded later that still lists the file follows the deletion too. + #expect(deleted.reconcile([older], chat: "a1").first?.attachments?.first?.deleted == true) + #expect(deleted.reconcile([older], chat: "a2").first?.attachments?.first?.deleted == false) + deleted.removeAll() + #expect(!deleted.contains("f1", chat: "a1")) + } +} diff --git a/apfelkern/Tests/apfelkernTests/CodingJobTests.swift b/apfelkern/Tests/apfelkernTests/CodingJobTests.swift index f7f6ad3..5d20501 100644 --- a/apfelkern/Tests/apfelkernTests/CodingJobTests.swift +++ b/apfelkern/Tests/apfelkernTests/CodingJobTests.swift @@ -1,4 +1,5 @@ import Foundation +import Synchronization import Testing @testable import apfelkern @@ -26,31 +27,194 @@ private func decode(_ json: String) throws -> Message { #expect(messageLabel(message) == "Coding job · fix-login") } -@Test func jobHistoryFoldsToolResultsIntoCalls() throws { - let calls = #"{"type":"toolCall","id":"t1","name":"bash","arguments":{"command":"swift test"}},"# - + #"{"type":"toolCall","id":"t2","name":"read","arguments":{"path":"a.swift"}}"# - let messages = try [ - decode(#"{"id":"u","role":"user","content":"Fix the build"}"#), - decode(#"{"id":"a","role":"assistant","blocks":[{"type":"text","text":"Running tests."},"# + calls + "]}"), - decode(#"{"id":"r","role":"toolResult","toolCallId":"t1","toolName":"bash","content":"boom","isError":true}"#) - ] - let items = CodingJobItem.items(from: messages) - #expect(items.count == 4) - guard case .tool(let bash) = items[2], case .tool(let read) = items[3] else { - Issue.record("expected tool items") - return - } - #expect(bash.subject == "swift test" && bash.output == "boom" && bash.isError && bash.finished) - #expect(read.subject == "a.swift" && !read.finished) +private func step(_ id: String, result: String? = nil) -> String { + let output = result.map { + #","result":{"id":"r","entryId":"r","role":"toolResult","content":"\#($0)","replyReferences":[]}"# + } ?? "" + return #"{"kind":"step","id":"\#(id)","tool":"bash","label":"Ran","icon":"terminal","subject":"ls"\#(output)}"# +} + +private func historyPage(_ items: [String], hasMore: Bool = false, oldest: String? = nil) -> StubResponse { + let oldestJSON = oldest.map { #""\#($0)""# } ?? "null" + let json = #"{"messages":[],"items":[\#(items.joined(separator: ","))],"# + + #""hasMore":\#(hasMore),"oldestEntryId":\#(oldestJSON)}"# + return StubResponse(body: Data(json.utf8)) +} + +@MainActor +private func waitFor(_ done: () -> Bool) async { + for _ in 0..<500 where !done() { try? await Task.sleep(for: .milliseconds(2)) } + #expect(done()) +} + +private func stepResult(_ history: JobHistory?, _ id: String) -> String? { + history?.items.lazy.compactMap { item -> JobStepItem? in + if case .step(let step) = item, step.id == id { step } else { nil } + }.first?.result?.content +} + +@Test func jobHistoryReadsTheServersItems() async throws { + let task = #"{"kind":"task","id":"u","text":"Fix the build"}"# + let reply = #"{"kind":"reply","id":"a:0","text":"Running tests."}"# + try await withClient(handler: { _ in historyPage([task, reply, step("t1", result: "boom")]) }, test: { client in + let page = try await client.jobHistory(.coding, agentID: "a1", name: "fix", before: "", limit: 100) + #expect(page.items.map(\.id) == ["u", "a:0", "t1"]) + guard case .step(let bash) = page.items[2] else { + Issue.record("expected a step") + return + } + #expect(bash.label == "Ran" && bash.icon == .terminal && bash.subject == "ls") + #expect(bash.finished && bash.shownOutput == "boom") + }) } @Test func shownOutputKeepsEveryLine() { - func tool(_ output: String) -> CodingJobItem.Tool { - CodingJobItem.Tool(id: "t", name: "bash", subject: "", output: output, isError: false, finished: true) + func step(_ output: String?) -> JobStepItem { + JobStepItem( + icon: .terminal, id: "t", kind: .step, label: "Ran", + result: output.map { + Components.Schemas.TranscriptMessage( + content: $0, entryId: "r", id: "r", replyReferences: [], role: "toolResult") + }, tool: "bash") } let lines = (1...500).map(String.init).joined(separator: "\n") - #expect(tool(lines + "\n\n").shownOutput == lines) - #expect(tool("\n").shownOutput == "No output.") + #expect(step(lines + "\n\n").shownOutput == lines) + #expect(step("\n").shownOutput == "No output.") + #expect(!step(nil).finished) +} + +@Test @MainActor func aStepTheNewestPageScrolledPastStillGetsItsResult() async throws { + let shifted = Mutex(false) + try await withClient(handler: { request in + let before = request.url?.query?.contains("before=2") == true + if before { return historyPage([step("call", result: "done")]) } + return shifted.withLock { $0 } + ? historyPage([#"{"kind":"task","id":"2","text":"Next"}"#], hasMore: true, oldest: "2") + : historyPage([step("call")]) + }, test: { client in + let board = JobBoard() + board.open(.coding, "fix", agentID: "a1", client: client) + await waitFor { board.history?.loaded == true } + #expect(stepResult(board.history, "call") == nil) + + shifted.withLock { $0 = true } + board.loadHistory(client: client) + await waitFor { stepResult(board.history, "call") != nil } + #expect(stepResult(board.history, "call") == "done") + #expect(board.history?.items.map(\.id) == ["call", "2"]) + }) +} + +@Test @MainActor func anEarlierPagesStepGetsItsResultWhenItArrives() async throws { + let finished = Mutex(false) + try await withClient(handler: { request in + guard request.url?.query?.contains("before=2") == true else { + return historyPage([#"{"kind":"task","id":"2","text":"Next"}"#], hasMore: true, oldest: "2") + } + return historyPage([finished.withLock { $0 } ? step("call", result: "done") : step("call")]) + }, test: { client in + let board = JobBoard() + board.open(.coding, "fix", agentID: "a1", client: client) + await waitFor { board.history?.loaded == true } + board.loadOlderHistory(client: client) + await waitFor { board.history?.items.count == 2 } + #expect(stepResult(board.history, "call") == nil) + + finished.withLock { $0 = true } + board.loadHistory(client: client) + await waitFor { stepResult(board.history, "call") != nil } + #expect(stepResult(board.history, "call") == "done") + }) +} + +@Test(arguments: [false, true]) +@MainActor func slowHistoryLoadsFinishWhileTheJobIsPolled(olderPage: Bool) async throws { + let requests = Mutex((listings: 0, newest: 0, older: 0)) + try await withClient(handler: { request in + if request.url?.lastPathComponent == "coding-jobs" { + requests.withLock { $0.listings += 1 } + return StubResponse(body: Data( + #"{"jobs":[{"name":"fix","conversationId":"c1","status":"working"}]}"#.utf8)) + } + if request.url?.query?.contains("before=2") == true { + requests.withLock { $0.older += 1 } + return StubResponse(body: historyPage([step("call", result: "done")]).body, delay: 0.2) + } + let load = requests.withLock { $0.newest += 1; return $0.newest } + if load == 1 { return historyPage([step("call")]) } + if olderPage { + return historyPage([#"{"kind":"task","id":"2","text":"Next"}"#], hasMore: true, oldest: "2") + } + return StubResponse(body: historyPage([step("call", result: "done")]).body, delay: 0.2) + }, test: { client in + let board = JobBoard() + board.refresh(.coding, agentID: "a1", client: client) + await waitFor { board.jobs["coding/fix"]?.isWorking == true } + board.open(.coding, "fix", agentID: "a1", client: client) + await waitFor { board.history?.loaded == true } + + let watcher = Task { await board.watch(every: .milliseconds(10), agentID: "a1", client: client) } + defer { watcher.cancel() } + await waitFor { requests.withLock { olderPage ? $0.older > 0 : $0.newest > 1 } } + let listings = requests.withLock { $0.listings } + await waitFor { requests.withLock { $0.listings >= listings + 4 } } + #expect(requests.withLock { $0.newest } == 2) + #expect(requests.withLock { $0.older } == (olderPage ? 1 : 0)) + #expect(stepResult(board.history, "call") == nil) + + await waitFor { stepResult(board.history, "call") == "done" } + #expect(board.jobs["coding/fix"]?.isWorking == true) + await waitFor { requests.withLock { $0.newest >= 3 } } + }) +} + +@Test @MainActor func anOlderHistoryLoadThatFinishesLateIsDropped() async throws { + let loads = Mutex(0) + try await withClient(handler: { _ in + switch loads.withLock({ $0 += 1; return $0 }) { + case 1: historyPage([step("call")]) + case 2: StubResponse(body: historyPage([step("call")]).body, delay: 0.2) + default: historyPage([step("call", result: "done"), #"{"kind":"task","id":"3","text":"Next"}"#]) + } + }, test: { client in + let board = JobBoard() + board.open(.coding, "fix", agentID: "a1", client: client) + await waitFor { board.history?.loaded == true } + board.loadHistory(client: client) + try await Task.sleep(for: .milliseconds(20)) + board.loadHistory(client: client) + await waitFor { board.history?.items.count == 2 } + try await Task.sleep(for: .milliseconds(300)) + #expect(board.history?.items.map(\.id) == ["call", "3"]) + #expect(stepResult(board.history, "call") == "done") + }) +} + +@Test @MainActor func aFailedOlderPageKeepsTheNewestPage() async throws { + let refreshed = Mutex(false) + try await withClient(handler: { request in + let older = request.url?.query?.contains("before=2") == true + guard refreshed.withLock({ $0 }) else { + return older ? historyPage([step("call")]) : historyPage([#"{"kind":"task","id":"2","text":"Next"}"#], + hasMore: true, oldest: "2") + } + if older { return StubResponse(status: 503, body: Data()) } + return historyPage( + [#"{"kind":"task","id":"2","text":"Next"}"#, #"{"kind":"task","id":"3","text":"Then"}"#], hasMore: true, + oldest: "2") + }, test: { client in + let board = JobBoard() + board.open(.coding, "fix", agentID: "a1", client: client) + await waitFor { board.history?.loaded == true } + board.loadOlderHistory(client: client) + await waitFor { board.history?.items.count == 2 } + + refreshed.withLock { $0 = true } + board.loadHistory(client: client) + await waitFor { board.history?.items.count == 3 } + #expect(board.history?.items.map(\.id) == ["call", "2", "3"]) + #expect(board.history?.error == "") + }) } @Test func draftDefaultsCodingOff() { diff --git a/apfelkern/Tests/apfelkernTests/ComposerControlsTests.swift b/apfelkern/Tests/apfelkernTests/ComposerControlsTests.swift index 1466f2f..5bc24fc 100644 --- a/apfelkern/Tests/apfelkernTests/ComposerControlsTests.swift +++ b/apfelkern/Tests/apfelkernTests/ComposerControlsTests.swift @@ -5,13 +5,6 @@ import UniformTypeIdentifiers @testable import apfelkern -private let modelsJSON = """ - [{"provider":"openai","id":"o4","name":"o4","contextWindow":1000,"reasoning":true, - "thinkingLevels":["low","medium","high"]}, - {"provider":"openai","id":"gpt","name":"gpt","contextWindow":1000,"reasoning":false, - "thinkingLevels":["off"]}] - """ - private func json(_ text: String, status: Int = 200, delay: TimeInterval = 0) -> StubResponse { StubResponse(status: status, body: Data(text.utf8), delay: delay) } @@ -28,31 +21,67 @@ private func bot(model: String, level: String = "off", tools: [String]? = nil) - inference: Inference(thinkingLevel: level, temperature: 0.5)) } -@Test(arguments: [ - (ThinkingLevel.medium, [ThinkingLevel.low, .medium], ThinkingLevel.medium), - (.off, [.low, .high], .low), - (.medium, [.low, .high], .high), - (.max, [.low, .high], .high), - (.high, [], .off) -]) -func aLevelClampsToTheNearestPreferringHigher(level: ThinkingLevel, levels: [ThinkingLevel], result: ThinkingLevel) { - #expect(level.clamped(to: levels) == result) -} +private let reasoningJSON = #"{"options":[{"value":"low","label":"Low"},{"value":"high","label":"Deep"}],"# + + #""effectiveLevel":"low"}"# -@Test @MainActor func reasoningFollowsTheModelsLevels() async throws { - try await withClient(handler: { _ in json(modelsJSON) }, test: { client in +@Test @MainActor func reasoningShowsWhatTheServerOffers() async throws { + let asked = Mutex<[JSONValue]>([]) + try await withClient(handler: { request in + asked.withLock { $0.append((try? requestJSON(request)) ?? .null) } + return json(reasoningJSON) + }, test: { client in let board = ReasoningBoard() - #expect(board.levels(of: bot(model: "o4")).isEmpty) + #expect(board.preview(of: bot(model: "o4")) == nil) + + await board.load(bot: bot(model: " o4 "), client: client, after: .zero) + let preview = try #require(board.preview(of: bot(model: "o4"))) + #expect(preview.options.map(\.label) == ["Low", "Deep"]) + #expect(preview.effectiveLevel == .low) + #expect(preview.label == "Low") + #expect(asked.withLock { $0 } == [ + .object(["provider": .string("openai"), "model": .string("o4"), "thinkingLevel": .string("off")]) + ]) + // A level the server offered for the model shows as itself until its own preview arrives. + #expect(board.preview(of: bot(model: "o4", level: "high"))?.effectiveLevel == .high) + #expect(board.preview(of: bot(model: "o4", level: "medium")) == nil) + #expect(board.preview(of: bot(model: "gpt")) == nil) - await board.load(provider: "openai", client: client) - #expect(board.levels(of: bot(model: "o4")) == [.low, .medium, .high]) - #expect(board.level(of: bot(model: "o4", level: "off")) == .low) - #expect(board.level(of: bot(model: "o4", level: "xhigh")) == .high) - #expect(board.levels(of: bot(model: "gpt")) == [.off]) - #expect(board.levels(of: bot(model: "unlisted")) == ThinkingLevel.allCases) + board.reset() + #expect(board.preview(of: bot(model: "o4")) == nil) + }) +} +@Test @MainActor func aReasoningPreviewForOldInputsOrAnOldConnectionIsDropped() async throws { + let asked = Mutex(0) + try await withClient(handler: { _ in + asked.withLock { $0 += 1 } + return json(reasoningJSON, delay: 0.05) + }, test: { client in + let board = ReasoningBoard() + let changed = Task { await board.load(bot: bot(model: "o4"), client: client) } + try await wait { asked.withLock { $0 } == 1 } + changed.cancel() + await changed.value + #expect(board.preview(of: bot(model: "o4")) == nil) + + let reconnected = Task { await board.load(bot: bot(model: "o4"), client: client, after: .zero) } + try await wait { asked.withLock { $0 } == 2 } board.reset() - #expect(board.levels(of: bot(model: "o4")).isEmpty) + await reconnected.value + #expect(board.preview(of: bot(model: "o4")) == nil) + + let typing = Task { await board.load(bot: bot(model: "o"), client: client, after: .milliseconds(50)) } + typing.cancel() + await typing.value + #expect(asked.withLock { $0 } == 2) + }) +} + +@Test @MainActor func aFailedReasoningPreviewHidesTheControl() async throws { + try await withClient(handler: { _ in json(#"{"error":"down"}"#, status: 503) }, test: { client in + let board = ReasoningBoard() + await board.load(bot: bot(model: "o4"), client: client, after: .zero) + #expect(board.preview(of: bot(model: "o4")) == nil) }) } @@ -124,18 +153,6 @@ func aLevelClampsToTheNearestPreferringHigher(level: ThinkingLevel, levels: [Thi #expect(PasteContent.fileType(in: [UTType.utf8PlainText.identifier, UTType.json.identifier]) == nil) } -@Test func anAutomationsCadenceReadsInWords() { - let words = { (cron: String) in - cadence(Schedule(id: "s", agentId: "a", name: "n", cron: cron, prompt: "p", timezone: TimeZone.current.identifier, - enabled: true)) - } - #expect(words("*/5 * * * *") == "Every 5 minutes") - #expect(words("30 * * * *") == "Every hour at :30") - #expect(words("0 8 * * *").hasPrefix("Every day at ")) - #expect(words("not a cron") == "not a cron") - #expect(cadence(Schedule(id: "s", agentId: "a", name: "n", prompt: "p", enabled: true)) == "Once") -} - @Test func aMemoryNamesWhereItCameFrom() { #expect(memorySourceLabel(nil) == nil) #expect(memorySourceLabel(MemorySource(kind: "chat")) == "From the bot chat") diff --git a/apfelkern/Tests/apfelkernTests/GroupChatSupportTests.swift b/apfelkern/Tests/apfelkernTests/GroupChatSupportTests.swift index 3cd88cc..ce990a8 100644 --- a/apfelkern/Tests/apfelkernTests/GroupChatSupportTests.swift +++ b/apfelkern/Tests/apfelkernTests/GroupChatSupportTests.swift @@ -4,11 +4,6 @@ import Testing @testable import apfelkern struct GroupChatSupportTests { - private let sources = [ - MessageSource(url: "https://Example.com/guide/", title: "The Guide"), - MessageSource(url: "https://example.com/other", title: "Other") - ] - @Test func groupRowsSkipTurnsWithNothingToShow() { let bot = MessageOrigin(kind: "bot", name: "Ada", agentId: "a1") let messages = [ @@ -16,7 +11,7 @@ struct GroupChatSupportTests { Message(id: "2", role: "assistant", content: .string("Booked."), origin: bot), Message( id: "3", role: "user", content: .string(""), - attachments: [AttachmentInfo(name: "a.png", mimeType: "image/png", size: 1, kind: "image")]) + attachments: [AttachmentInfo(id: "f1", name: "a.png", mimeType: "image/png", size: 1)]) ] let rows = GroupChatRow.rows(messages: messages, snapshot: nil, agents: [], hasMore: false) #expect(rows.map(\.id) == ["2", "3"]) @@ -46,38 +41,6 @@ struct GroupChatSupportTests { #expect(draft.memberIDs == ["a3", "a2"]) } - @Test func onlyParenthesesThatHeldACitationGoAway() { - let split = SourceCitations.split( - "Call `run()` or run() first (source: [source](https://example.com/guide)) and ( ) stays.", - sources: sources) - #expect(split.text == "Call `run()` or run() first and ( ) stays.") - } - - @Test func aBotChatReplyListsThePagesItsTurnRead() { - let page: (String, String) -> JSONValue = { .object(["url": .string($0), "title": .string($1)]) } - let result: (String, [JSONValue], Bool) -> Message = { tool, pages, failed in - Message( - id: UUID().uuidString, role: "toolResult", toolName: tool, isError: failed, - toolDetails: .array(pages)) - } - let messages = [ - Message(id: "ask", role: "user", content: .string("Where?")), - result("web_search", [page("https://a.test", "A")], false), - result("web_extract", [.object(["url": .string("https://b.test"), "error": .string("Gone")])], false), - result("web_search", [page("https://failed.test", "Failed")], true), - result("memory_search", [page("https://other.test", "Other")], false), - Message(id: "first", role: "assistant", content: .string("Here.")), - result("web_extract", [page("https://c.test", "C")], false), - Message(id: "second", role: "assistant", content: .string("And here.")), - Message(id: "next", role: "user", content: .string("Thanks")), - Message(id: "third", role: "assistant", content: .string("Welcome.")) - ] - let replies = SourceCitations.byReply(messages) - #expect(replies["first"] == [MessageSource(url: "https://a.test", title: "A")]) - #expect(replies["second"]?.map(\.title) == ["A", "C"]) - #expect(replies["third"] == nil) - } - @Test func noticeKindFollowsWhatTheReplyWaitsFor() { func kind(_ waitingFor: String?) -> NoticeKind { NoticeKind(ActivityEvent(type: "reply", agentId: "a", agentName: "A", waitingFor: waitingFor)) @@ -96,32 +59,21 @@ struct GroupChatSupportTests { #expect(decoded.waitingFor == "login") } - @Test func citationsOfReadPagesBecomeChipsOnce() { - let split = SourceCitations.split( - "Pack light ([source](https://example.com/guide), [source](https://EXAMPLE.com/guide/#top)). " - + "See [source](https://example.com/other).", - sources: sources) - #expect(split.text == "Pack light. See.") - #expect(split.chips == [ - SourceChip(href: "https://example.com/guide", title: "The Guide"), - SourceChip(href: "https://example.com/other", title: "Other") - ]) - } - - @Test func citationsOfUnknownPagesAndCodeStayInTheText() { - let text = "[source](https://elsewhere.com) and `[source](https://example.com/other)`\n" - + "```\n[source](https://example.com/guide)\n```" - let split = SourceCitations.split(text, sources: sources) - #expect(split.text == text) - #expect(split.chips.isEmpty) - } - - @Test func wireMessagesCarryTheirSources() throws { + @Test func aReplyShowsTheServersPresentationAndKeepsItsRawText() throws { let wire = try JSONDecoder().decode(Components.Schemas.TranscriptMessage.self, from: Data(#""" - {"id":"g:1:0","entryId":"g:1","role":"assistant","content":"Hi", - "sources":[{"url":"https://example.com","title":"Example"}]} + {"id":"g:1:0","entryId":"g:1","role":"assistant","content":"Pack light ([source](https://example.com/a)).", + "replyReferences":[],"sources":[{"url":"https://example.com/a","title":"Guide"}], + "presentation":{"text":"Pack light.","citations":[ + {"href":"https://example.com/a","title":"Guide","site":"example.com"}]}} """#.utf8)) - #expect(try Message(wire: wire).sources == [MessageSource(url: "https://example.com", title: "Example")]) + let message = try Message(wire: wire) + #expect(message.text == "Pack light ([source](https://example.com/a)).") + #expect(message.presentedText == "Pack light.") + #expect(message.citations == [Citation(href: "https://example.com/a", site: "example.com", title: "Guide")]) + + let plain = Message(id: "2", role: "assistant", content: .string("See [source](https://example.com/a).")) + #expect(plain.presentedText == "See [source](https://example.com/a).") + #expect(plain.citations.isEmpty) } @Test func aGroupReplyIsLabelledWithItsBot() { diff --git a/apfelkern/Tests/apfelkernTests/HeldActionBoardTests.swift b/apfelkern/Tests/apfelkernTests/HeldActionBoardTests.swift index d113b58..2b374a9 100644 --- a/apfelkern/Tests/apfelkernTests/HeldActionBoardTests.swift +++ b/apfelkern/Tests/apfelkernTests/HeldActionBoardTests.swift @@ -41,10 +41,12 @@ private func waiting(_ client: APIClient, agent: String = "a1") async throws -> board.select(agent) board.refreshIfChanged(messages: [heldEvent], client: client) #expect(board.state(of: "h1") == .outcome("Loading…")) + #expect(!board.isReady("h1")) try await wait { if case .waiting = board.state(of: "h1") { return true } return false } + #expect(board.isReady("h1")) return board } @@ -67,6 +69,7 @@ func aDecidedActionSettlesItsCard(status: String, outcome: String) async throws board.select("a1") board.refreshIfChanged(messages: [heldEvent], client: client) try await wait { board.state(of: "h1") == .outcome(outcome) } + #expect(board.isReady("h1")) #expect(!board.needsPolling) }) } @@ -77,6 +80,7 @@ func aDecidedActionSettlesItsCard(status: String, outcome: String) async throws board.select("a1") board.refreshIfChanged(messages: [heldEvent], client: client) try await wait { board.state(of: "h1") == .outcome("Unavailable") } + #expect(!board.isReady("h1")) }) } diff --git a/apfelkern/Tests/apfelkernTests/ParityGapTests.swift b/apfelkern/Tests/apfelkernTests/ParityGapTests.swift index 99ebf10..86955fa 100644 --- a/apfelkern/Tests/apfelkernTests/ParityGapTests.swift +++ b/apfelkern/Tests/apfelkernTests/ParityGapTests.swift @@ -70,20 +70,3 @@ import Testing #expect(!entry(kind: "change", ["isError": .bool(true)]).failed) } } - -@Suite struct ModelReasoningTests { - private let models = [ - ModelSummary(provider: "p", id: "fast", thinkingLevels: [.off]), - ModelSummary(provider: "p", id: "deep", thinkingLevels: [.off, .high]) - ] - - @Test func aListedModelLimitsTheLevels() { - #expect(ThinkingLevel.available(for: "deep", in: models) == [.off, .high]) - #expect(ThinkingLevel.available(for: " deep ", in: models) == [.off, .high]) - } - - @Test func anUnlistedModelOffersEveryLevel() { - #expect(ThinkingLevel.available(for: "other", in: models) == ThinkingLevel.allCases) - #expect(ThinkingLevel.available(for: nil, in: models) == ThinkingLevel.allCases) - } -} diff --git a/apfelkern/Tests/apfelkernTests/ReplyAttentionTests.swift b/apfelkern/Tests/apfelkernTests/ReplyAttentionTests.swift new file mode 100644 index 0000000..0754e56 --- /dev/null +++ b/apfelkern/Tests/apfelkernTests/ReplyAttentionTests.swift @@ -0,0 +1,254 @@ +import CoreGraphics +import Foundation +import Synchronization +import Testing +@testable import apfelkern + +private let references = #"[{"eventId":"text-event","surface":{"kind":"text"}},"# + + #"{"eventId":"tool-event","surface":{"kind":"tool-card","toolCallId":"t1"}},"# + + #"{"eventId":"held-event","surface":{"kind":"held-action","actionId":"h1"}},"# + + #"{"eventId":"text-event","surface":{"kind":"text"}}]"# + +private func transcriptMessage(_ content: String = "Answer", references: String = references) -> String { + #"{"id":"a1:1:0","entryId":"a1:1","role":"assistant","content":"\#(content)","replyReferences":\#(references)}"# +} + +private func chatSnapshot(_ content: String = "Answer", references: String = references) -> String { + #"{"agentId":"a1","status":"idle","working":"idle","partial":"","updatedAt":0,"error":null,"hasMore":false,"# + + #""oldestEntryId":null,"conversationId":"c1","# + + #""conversation":{"id":"c1","agentId":"a1","title":"Chat","createdAt":"now","updatedAt":"now"},"# + + #""messages":[\#(transcriptMessage(content, references: references))]}"# +} + +private let groupSnapshot = #"{"groupChat":{"id":"g1","name":"Trip","memberIds":["a1","a2"],"# + + #""createdAt":"now","updatedAt":"now"},"activity":{"paused":false,"botTurns":0,"members":[]},"# + + #""messages":[{"id":"g1:1:0","entryId":"g1:1","role":"assistant","content":"Packed","# + + #""origin":{"kind":"bot","agentId":"a1","name":"Ada"},"# + + #""replyReferences":[{"eventId":"group-event","surface":{"kind":"text"}}]}],"hasMore":false,"# + + #""oldestEntryId":null,"updatedAt":1}"# + +@Test func referencesSurviveHistoryTheStreamAndAGroupSnapshot() async throws { + let expected = [ + ReplyReference(eventId: "text-event", surface: .text), + ReplyReference(eventId: "tool-event", surface: .toolCard("t1")), + ReplyReference(eventId: "held-event", surface: .heldAction("h1")), + ReplyReference(eventId: "text-event", surface: .text) + ] + let streamed = try JSONDecoder().decode(ChatSnapshot.self, from: Data(chatSnapshot().utf8)) + #expect(streamed.messages?.first?.replyReferences == expected) + let group = try JSONDecoder().decode(GroupChatSnapshot.self, from: Data(groupSnapshot.utf8)) + #expect(group.messages.first?.replyReferences == [ReplyReference(eventId: "group-event", surface: .text)]) + try await withClient(handler: { request in + let body = request.url?.path.hasSuffix("/history") == true + ? #"{"messages":[\#(transcriptMessage())],"hasMore":false,"oldestEntryId":null}"# : chatSnapshot() + return StubResponse(body: Data(body.utf8)) + }, test: { client in + #expect(try await client.chat("a1").messages?.first?.replyReferences == expected) + let page = try await client.chatHistory("a1", before: "", limit: 5) + #expect(page.messages?.first?.replyReferences == expected) + }) + let message = try #require(streamed.messages?.first) + let saved = try JSONDecoder().decode(Message.self, from: JSONEncoder().encode(message)) + #expect(saved.replyReferences == expected) +} + +@Test func onlyTheExactSurfaceAcknowledgesItsEvents() throws { + let message = try #require( + try JSONDecoder().decode(ChatSnapshot.self, from: Data(chatSnapshot().utf8)).messages?.first) + #expect(message.attentionEventIDs(for: .text) == ["text-event"]) + #expect(message.attentionEventIDs(for: .toolCard("t1")) == ["tool-event"]) + #expect(message.attentionEventIDs(for: .heldAction("h1")) == ["held-event"]) + #expect(message.attentionEventIDs(for: .toolCard("t2")).isEmpty) + #expect(message.attentionEventIDs(for: .heldAction("t1")).isEmpty) + #expect(message.showsReplyText) + + let citationsOnly = Message( + id: "m", role: "assistant", content: .string("[a](https://example.com)"), + presentation: MessagePresentation(citations: [], text: " \n")) + #expect(!citationsOnly.showsReplyText) + #expect(!Message(id: "m", role: "user", content: .string("Hi")).showsReplyText) +} + +@MainActor @Test func cardsNameTheirSurfaceAndWaitForTheirBoards() throws { + let held = Message( + id: "m1", role: "event", kind: HeldActionEvent.messageKind, heldAction: HeldActionEvent(id: "h1", job: "j")) + let secret = Message( + id: "m2", role: "toolResult", toolName: BotSecretKind.credential.toolName, toolCallId: "t1", + toolDetails: .object(["name": .string("TOKEN")])) + let unnamed = Message( + id: "m3", role: "toolResult", toolName: BotSecretKind.credential.toolName, + toolDetails: .object(["name": .string("TOKEN")])) + func card(_ message: Message) -> (surface: ReplySurface, ready: Bool)? { + message.replyCard( + heldActions: HeldActionBoard(), botRequests: BotRequestBoard(), callRequests: CallRequestBoard(), + botSecrets: BotSecretBoard()) + } + #expect(card(held)?.surface == .heldAction("h1")) + #expect(card(held)?.ready == false) + #expect(card(secret)?.surface == .toolCard("t1")) + #expect(card(secret)?.ready == false) + #expect(card(unnamed) == nil) + #expect(card(Message(id: "m4", role: "assistant", content: .string("Hi"))) == nil) +} + +@Test func aSurfaceCountsOnlyWithAreaInsideTheViewport() { + let viewport = CGRect(x: 0, y: 100, width: 300, height: 300) + let content = CGRect(x: 10, y: 150, width: 200, height: 50) + #expect(replySurfaceVisible(ready: true, frame: content, viewport: viewport)) + #expect(!replySurfaceVisible(ready: false, frame: content, viewport: viewport)) + #expect(!replySurfaceVisible(ready: true, frame: .zero, viewport: viewport)) + #expect(!replySurfaceVisible(ready: true, frame: content, viewport: .zero)) + #expect(!replySurfaceVisible(ready: true, frame: CGRect(x: 10, y: 0, width: 200, height: 100), viewport: viewport)) + #expect(!replySurfaceVisible(ready: true, frame: CGRect(x: 10, y: 400, width: 200, height: 9), viewport: viewport)) + #expect(replySurfaceVisible(ready: true, frame: CGRect(x: 10, y: 0, width: 200, height: 101), viewport: viewport)) + + var surfaces = ReplySurfaces() + let container = CGSize(width: 300, height: 400) + surfaces.set("a", of: .bot("a1"), frame: content, container: container, eventIDs: ["e1", "e2"], ready: true) + surfaces.set("b", of: .bot("a1"), frame: content, container: container, eventIDs: ["e2"], ready: true) + surfaces.set("c", of: .group("a1"), frame: content, container: container, eventIDs: ["g"], ready: true) + #expect(Set(surfaces.visibleEventIDs(in: .bot("a1"))) == ["e1", "e2"]) + #expect(surfaces.visibleEventIDs(in: .bot("a1")).count == 2) + #expect(surfaces.visibleEventIDs(in: .group("a1")) == ["g"]) + surfaces.setInsets(top: 0, bottom: 260) + #expect(surfaces.visibleEventIDs(in: .bot("a1")).isEmpty) + surfaces.setInsets(top: 0, bottom: 0) + surfaces.keep(only: .group("a1")) + #expect(surfaces.visibleEventIDs(in: .bot("a1")).isEmpty) +} + +@Test func routesAndRepliesNameTheirChat() { + #expect(Route.agent("a1").attentionChat == .bot("a1")) + #expect(Route.group("g1").attentionChat == .group("g1")) + #expect(Route.skills.attentionChat == nil) + let reply = ActivityEvent(type: "reply", agentId: "a1", agentName: "Ada") + #expect(reply.attentionChat == .bot("a1")) + var groupReply = reply + groupReply.groupId = "g1" + #expect(groupReply.attentionChat == .group("g1")) +} + +// MARK: Reloading references after a live reply + +/// The least a chat needs to host group chats, applying bot snapshots by merge as the apps do. +@MainActor +private final class Host: GroupChatHost { + var client: APIClient? + var generation = 0 + var mutationRevision = 0 + var pendingMutations: Set = [] + var route: Route? + var selectedAgentID = "" + var selectionVersion = 0 + var groupChats: [GroupChat] = [] + var selectedGroupID = "" + var groupSnapshot: GroupChatSnapshot? + var groupDraft: GroupDraft? + var groupStreamTask: Task? + var composerDrafts = ComposerDrafts() + var groupArrivals = 0 + var messages: [Message] = [] + var hasMore = false + var oldestEntryID = "" + var loadingOlder = false + var draft = "" + var attachments: [PendingAttachment] = [] + var replyTo: Message? + var sending = false + var draftRequestID = "" + var failedDraft = "" + var failedReplyTo = "" + var failedAttachments: [UUID] = [] + var delivery = BotChatDelivery() + var deletedFiles = DeletedFiles() + var errorText = "" + var streamStatus = "" + var snapshotRevision = 0 + + init(client: APIClient) { + self.client = client + } + + func leaveBotChat() { selectedAgentID = "" } + + func applySnapshot(_ incoming: ChatSnapshot) { + snapshotRevision += 1 + messages = mergeMessages(messages, incoming.messages ?? []) + } + + func request(_ work: @escaping @MainActor (APIClient) async throws -> (@MainActor () -> Void)?) {} + + func optimisticMutation( + key: String, update: () -> Void, rollback: @escaping @MainActor () -> Void, + work: @escaping @MainActor (APIClient) async throws -> (@MainActor () -> Void)? + ) {} + + func showNotice(_ text: String) {} +} + +@MainActor +private func eventually(_ done: () -> Bool) async throws { + for _ in 0..<300 where !done() { try await Task.sleep(for: .milliseconds(10)) } + #expect(done()) +} + +private let reply = ActivityEvent(eventId: "text-event", type: "reply", agentId: "a1", agentName: "Ada") + +private final class Reads: Sendable { + let count = Mutex(0) +} + +private func reloads(_ reads: Reads) -> ContractURLProtocol.Handler { + { request in + reads.count.withLock { $0 += 1 } + let body = request.url?.path.contains("/group-chats/") == true ? groupSnapshot : chatSnapshot("Reloaded") + return StubResponse(body: Data(body.utf8), delay: 0.15) + } +} + +@MainActor @Test func aLiveReplyReloadsTheBotChatOnScreenUnlessSomethingNewerLandsFirst() async throws { + let reads = Reads() + try await withClient(handler: reloads(reads), test: { client in + let host = Host(client: client) + host.route = .agent("a1") + host.selectedAgentID = "a1" + host.draft = "Keep this" + host.refreshReplyReferences(after: reply, active: false) + var other = reply + other.agentId = "a2" + host.refreshReplyReferences(after: other, active: true) + try await Task.sleep(for: .milliseconds(50)) + #expect(reads.count.withLock { $0 } == 0) + + host.refreshReplyReferences(after: reply, active: true) + host.applySnapshot(try JSONDecoder().decode(ChatSnapshot.self, from: Data(chatSnapshot("Streamed").utf8))) + try await Task.sleep(for: .milliseconds(300)) + #expect(reads.count.withLock { $0 } == 1) + #expect(host.messages.map(\.text) == ["Streamed"]) + + host.refreshReplyReferences(after: reply, active: true) + host.selectionVersion += 1 + try await Task.sleep(for: .milliseconds(300)) + #expect(host.messages.map(\.text) == ["Streamed"]) + + host.refreshReplyReferences(after: reply, active: true) + try await eventually { host.messages.map(\.text) == ["Reloaded"] } + #expect(host.messages.first?.attentionEventIDs(for: .text) == ["text-event"]) + #expect(host.draft == "Keep this") + }) +} + +@MainActor @Test func aLiveGroupReplyReloadsTheGroupOnScreenAndKeepsTheDraft() async throws { + try await withClient(handler: reloads(Reads()), test: { client in + let host = Host(client: client) + host.selectedGroupID = "g1" + host.route = .group("g1") + host.draft = "Keep this" + var groupReply = reply + groupReply.groupId = "g1" + host.refreshReplyReferences(after: groupReply, active: true) + try await eventually { host.messages.contains { $0.id == "g1:1:0" } } + #expect(host.messages.first { $0.id == "g1:1:0" }?.attentionEventIDs(for: .text) == ["group-event"]) + #expect(host.draft == "Keep this") + }) +} diff --git a/apfelkern/Tests/apfelkernTests/TestSupport.swift b/apfelkern/Tests/apfelkernTests/TestSupport.swift index e9a711a..e120b17 100644 --- a/apfelkern/Tests/apfelkernTests/TestSupport.swift +++ b/apfelkern/Tests/apfelkernTests/TestSupport.swift @@ -61,6 +61,10 @@ final class ContractURLProtocol: URLProtocol, @unchecked Sendable { } func requestJSON(_ request: URLRequest) throws -> JSONValue { + try JSONDecoder().decode(JSONValue.self, from: requestBody(request)) +} + +func requestBody(_ request: URLRequest) -> Data { var streamBody = Data() if let stream = request.httpBodyStream { stream.open() @@ -72,7 +76,7 @@ func requestJSON(_ request: URLRequest) throws -> JSONValue { streamBody.append(contentsOf: buffer.prefix(count)) } } - return try JSONDecoder().decode(JSONValue.self, from: request.httpBody ?? streamBody) + return request.httpBody ?? streamBody } func withClient( diff --git a/apfelkern/scripts/contract.py b/apfelkern/scripts/contract.py index a6cf693..3ef77c1 100644 --- a/apfelkern/scripts/contract.py +++ b/apfelkern/scripts/contract.py @@ -51,6 +51,26 @@ def project(node, schemas=None): return result +def comparable(node): + """A schema without what only one copy states: open properties and the OpenAPI discriminator.""" + node = project(node) + if isinstance(node, list): + return [comparable(item) for item in node] + if not isinstance(node, dict): + return node + return {key: comparable(value) for key, value in node.items() if key not in ("additionalProperties", "discriminator")} + + +def share_definitions(event, schemas): + """Point an event's $defs at the matching OpenAPI components, which differ only in open properties and discriminators.""" + definitions = event.pop("$defs", {}) + for name, definition in definitions.items(): + shared = json.loads(json.dumps(definition).replace('"#/$defs/', '"#/components/schemas/')) + if name not in schemas or comparable(shared) != comparable(schemas[name]): + raise ValueError(f"Event definition {name} does not match components/schemas/{name}") + return json.loads(json.dumps(event).replace('"#/$defs/', '"#/components/schemas/')) + + def generate(directory): cache = ROOT / ".build" / f"openapi-generator-{VERSION}" if not cache.exists(): @@ -65,7 +85,8 @@ def generate(directory): binary_dir = subprocess.check_output(["swift", "build", "--package-path", str(cache), "-c", "release", "--show-bin-path"], text=True).strip() document = json.loads((ROOT / "Contract" / "openapi.json").read_text()) for name, asset in [("EventChatSnapshot", "chat-snapshot.schema.json"), ("EventGroupChatSnapshot", "group-chat-snapshot.schema.json"), ("EventActivity", "activity-event.schema.json"), ("EventHeartbeat", "heartbeat.schema.json"), ("EventDesktopControl", "desktop-control.schema.json")]: - document["components"]["schemas"][name] = project(json.loads((ROOT / "Contract" / asset).read_text())) + event = share_definitions(json.loads((ROOT / "Contract" / asset).read_text()), document["components"]["schemas"]) + document["components"]["schemas"][name] = project(event) document = project(document, document["components"]["schemas"]) source = directory / "openapi.json" source.write_text(json.dumps(document, sort_keys=True, indent=2) + "\n") diff --git a/ios/CHANGELOG.md b/ios/CHANGELOG.md index e04fe26..c71660c 100644 --- a/ios/CHANGELOG.md +++ b/ios/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +- Allow renaming and editing completed one-time automations without rescheduling them. Keep job history updating on slow connections. +- Attachments work with the current server: files upload before their message and a retry uploads only those that failed. A file deleted from the chat's library shows **File deleted** instead of its preview. +- While the app is in the foreground, it tells the server which chat it shows, so a reply there sends no push to any of your devices, including your Mac. Replies you've seen on screen count as seen everywhere, and a waiting card counts once it shows its request. This works without notification permission, and leaving the chat, the app, or the account clears it. +- Automation timing, next runs, and the editor's next-run line come from the server, so they read as on the web, and the list's next runs stay current while it's open. For a new or changed trigger, **Save** is unavailable while the server says it can't run. Unchanged triggers and failed previews don't block saving. Reasoning levels in the composer and the bot form, cited pages under a reply, a job's steps, and what a working bot is doing come from the server too. + - **Settings** no longer configures the server. Providers, the judge and vision models, web search, credentials and logins across bots, password managers, Integrations, Coding, Users, message gateways, and the event relay are set up in Crumble on the web. **Server Settings** opens it in the browser, and links that led to those pages, such as **Provider Settings…** under a failed reply, open the matching web page. - A bot's request to call someone other than you appears in its chat with the callee, the number, the goal, and the opening it will say, and you approve or decline it there. A call that is under way or over shows as a row with its state; tap it to read the goal and the conversation, which updates during the call. - A chat shows a voice gateway call as centered phone lines, as on the web: **Call started**, or, when the bot placed the call, that it called you over the greeting it spoke, and then how the call ended, with any reaction the bot left on it. A message spoken on a call says **Spoken on a call**. diff --git a/ios/Crumble/Core/AppModel+Attention.swift b/ios/Crumble/Core/AppModel+Attention.swift new file mode 100644 index 0000000..cdbc88e --- /dev/null +++ b/ios/Crumble/Core/AppModel+Attention.swift @@ -0,0 +1,30 @@ +import apfelkern +import UIKit + +extension AppModel { + /// Reports the chat the scene shows while it's active and the account signed in. + func updateChatAttention() { + chatAttention.update(client: isSignedIn ? client : nil, active: attentionActive, route: route?.attentionChat) + } + + /// Only an active scene has attention. Leaving it gets a short grace, so the clear can land before iOS suspends + /// the app; a clear that doesn't expires on the server. + func setSceneActive(_ active: Bool) { + guard active != attentionActive else { return } + attentionActive = active + guard !active, attentionGrace == .invalid else { return } + attentionGrace = UIApplication.shared.beginBackgroundTask(withName: "Clear chat attention") { [weak self] in + Task { @MainActor in self?.endAttentionGrace() } + } + Task { + await chatAttention.settle() + endAttentionGrace() + } + } + + private func endAttentionGrace() { + guard attentionGrace != .invalid else { return } + UIApplication.shared.endBackgroundTask(attentionGrace) + attentionGrace = .invalid + } +} diff --git a/ios/Crumble/Core/AppModel+Automations.swift b/ios/Crumble/Core/AppModel+Automations.swift index 497bbd0..dc00e06 100644 --- a/ios/Crumble/Core/AppModel+Automations.swift +++ b/ios/Crumble/Core/AppModel+Automations.swift @@ -25,6 +25,10 @@ extension AppModel { automationBoard.saveDraft(client: client) { [self] in showNotice("Automation could not be saved") } } + func loadAutomationPreview() async { + if let client { await automationBoard.loadPreview(client: client) } + } + func runAutomation(_ schedule: Schedule) { guard let client else { return } let routeAtStart = route diff --git a/ios/Crumble/Core/AppModel+Chat.swift b/ios/Crumble/Core/AppModel+Chat.swift index d6fdaa3..fe90a56 100644 --- a/ios/Crumble/Core/AppModel+Chat.swift +++ b/ios/Crumble/Core/AppModel+Chat.swift @@ -120,13 +120,15 @@ extension AppModel { /// Keeps older pages the owner already loaded; snapshots only carry the newest page. func applySnapshot(_ incoming: ChatSnapshot) { + snapshotRevision += 1 let incomingMessages = incoming.messages ?? [] let acknowledged = Set(incomingMessages.compactMap(\.requestId)) delivery.acknowledge(botID: selectedAgentID, requestIDs: acknowledged) // Rebuild from confirmed transcript rows and append local rows so a delayed snapshot // cannot erase a message the user has already seen. let local = delivery.messages(botID: selectedAgentID) - messages = mergeMessages(messages.filter { $0.deliveryState == .confirmed }, incomingMessages) + messages = deletedFiles.reconcile( + mergeMessages(messages.filter { $0.deliveryState == .confirmed }, incomingMessages), chat: selectedAgentID) messages.append(contentsOf: local) refreshJobsIfChanged() refreshHeldActionsIfChanged() @@ -257,6 +259,7 @@ extension AppModel { agents[index].lastMessage = lastMessage } if event.type == "reply", let group = event.groupId { noteConversationMoved(.group(group), preview: event.preview) } + refreshReplyReferences(after: event, active: attentionActive) let context = NotificationContext( appActive: UIApplication.shared.applicationState == .active, route: route) guard let note = notification(for: event, in: context) else { return } @@ -287,7 +290,7 @@ extension AppModel { return { [self] in guard selectionVersion == version else { return } loadingOlder = false - messages = mergeMessages(messages, page.messages ?? []) + messages = deletedFiles.reconcile(mergeMessages(messages, page.messages ?? []), chat: id) refreshHeldActionsIfChanged() refreshBotRequestsIfChanged() refreshCallRequestsIfChanged() diff --git a/ios/Crumble/Core/AppModel+GroupChats.swift b/ios/Crumble/Core/AppModel+GroupChats.swift index 5d90ee0..f87fcaa 100644 --- a/ios/Crumble/Core/AppModel+GroupChats.swift +++ b/ios/Crumble/Core/AppModel+GroupChats.swift @@ -1,11 +1,6 @@ import apfelkern extension AppModel: GroupChatHost { - /// Where the open conversation's optimistic messages live. - var conversationKey: String { - selectedGroupID.isEmpty ? selectedAgentID : GroupChat.deliveryKey(selectedGroupID) - } - func leaveBotChat() { cancelStream() updateSelectedAgent("") diff --git a/ios/Crumble/Core/AppModel+Messages.swift b/ios/Crumble/Core/AppModel+Messages.swift index ae01ef1..0e4ec11 100644 --- a/ios/Crumble/Core/AppModel+Messages.swift +++ b/ios/Crumble/Core/AppModel+Messages.swift @@ -30,7 +30,8 @@ extension AppModel { } } - /// Re-sends a failed optimistic row with its original idempotency key and attachments. + /// Re-sends a failed optimistic row with its original idempotency key and attachments, uploading only the files + /// an earlier attempt did not. func retryMessage(_ message: Message) { guard selectedGroupID.isEmpty else { return retryGroupMessage(message) } guard message.deliveryState == .failed, let requestID = message.requestId, let client, @@ -73,9 +74,12 @@ extension AppModel { let id = context.id let requestID = context.requestID do { + guard let fileIDs = try await uploadFiles( + record, chat: id, requestID: requestID, generation: context.generation, + upload: { try await client.uploadFile(id, $0) }) + else { return } try await client.sendChatMessage( - id, content: record.content, requestID: requestID, replyTo: record.replyTo, - attachments: record.attachments.map(\.outgoing)) + id, content: record.content, requestID: requestID, replyTo: record.replyTo, files: fileIDs) guard generation == context.generation else { return } delivery.accepted(botID: id, requestID: requestID) guard selectionVersion == context.selection, selectedAgentID == id else { return } @@ -99,7 +103,7 @@ extension AppModel { private func failMessage(_ error: Error, id: String, requestID: String, version: Int) -> Bool { if selectionVersion == version, selectedAgentID == id { sending = false } - guard delivery.fail(botID: id, requestID: requestID) else { return false } + guard delivery.fail(botID: id, requestID: requestID, error: error) else { return false } if selectionVersion == version, selectedAgentID == id { errorText = "Message was not confirmed: " + friendlyError(error) if let visible = messages.firstIndex(where: { $0.requestId == requestID }) { @@ -138,12 +142,8 @@ extension AppModel { attachments.removeAll { $0.id == id } } - func attachmentImage(entryID: String, index: Int) -> UIImage? { - attachmentImages["\(entryID)/\(index)"] - } - func attachmentImage(message: Message, index: Int) -> UIImage? { - if let entryID = message.entryId { return attachmentImage(entryID: entryID, index: index) } + if message.entryId != nil { return attachmentKey(message, index: index).flatMap { attachmentImages[$0] } } guard let requestID = message.requestId, let data = delivery.imageData(botID: conversationKey, requestID: requestID, index: index) else { return nil } @@ -151,15 +151,9 @@ extension AppModel { } func loadAttachmentImage(entryID: String, index: Int) async { - let key = "\(entryID)/\(index)" - guard attachmentImages[key] == nil, let client else { return } - guard !entryID.hasPrefix("local:") else { return } - let agent = selectedAgentID - let group = selectedGroupID - let data = group.isEmpty - ? try? await client.attachment(agent, entryID: entryID, index: index) - : try? await client.groupAttachment(group, entryID: entryID, index: index) - guard let data, let image = UIImage(data: data) + guard let (key, data) = await downloadAttachment( + entryID: entryID, index: index, cached: { attachmentImages[$0] != nil }), + let image = UIImage(data: data) else { return } cacheAttachmentImage(image, key: key) } diff --git a/ios/Crumble/Core/AppModel.swift b/ios/Crumble/Core/AppModel.swift index 6b7c288..0c49679 100644 --- a/ios/Crumble/Core/AppModel.swift +++ b/ios/Crumble/Core/AppModel.swift @@ -18,7 +18,9 @@ final class AppModel { var agents: [Agent] = [] var capabilities: ServerCapabilities? - var route: Route? + var route: Route? { + didSet { if route != oldValue { updateChatAttention() } } + } var botDesktop: BotDesktopTarget? private(set) var selectedAgentID = "" var selectionVersion = 0 @@ -77,7 +79,8 @@ final class AppModel { var failedReplyTo = "" var failedAttachments: [UUID] = [] var delivery = BotChatDelivery() - /// Sent images, keyed by entry and attachment index; they never change once sent. + var deletedFiles = DeletedFiles() + /// Sent images, keyed by chat and file ID; a new connection clears them. private(set) var attachmentImages: [String: UIImage] = [:] private var activeRequests = 0 @@ -95,6 +98,14 @@ final class AppModel { var streamsSuspended = false var chatStreamVersion = 0 var activityVersion = 0 + /// Which chat the scene shows, for the server's push suppression, and which replies the owner saw. + let chatAttention = ChatAttention() + /// The scene is in the foreground and active. + @ObservationIgnored var attentionActive = false { + didSet { if attentionActive != oldValue { updateChatAttention() } } + } + @ObservationIgnored var attentionGrace = UIBackgroundTaskIdentifier.invalid + @ObservationIgnored var snapshotRevision = 0 var agentMemories: [String: [Memory]] = [:] var memoryLoadVersion = 0 @@ -254,6 +265,8 @@ extension AppModel { pendingMutations.removeAll() mutationRevision += 1 resetPendingMessages() + deletedFiles.removeAll() + attachmentImages = [:] agents = [] capabilities = nil jobBoard.reset() @@ -292,6 +305,7 @@ extension AppModel { groupDraft = nil messages = [] client = candidate + updateChatAttention() Notifier.shared.connectionChanged() activeRequests = 0 loading = false @@ -345,7 +359,10 @@ extension AppModel { func signOut() { guard let client, !accountBoard.isSigningOut else { return } Task { - let outcome = await accountBoard.signOut(client: client) { await Notifier.shared.releaseConnection() } + let outcome = await accountBoard.signOut(client: client) { + await self.chatAttention.disconnect(client) + await Notifier.shared.releaseConnection() + } Keychain.delete("server-token") token = "" applyConnection(APIClient(baseURL: client.baseURL, token: "")) diff --git a/ios/Crumble/Core/Notifications.swift b/ios/Crumble/Core/Notifications.swift index 10fec89..fa1eac1 100644 --- a/ios/Crumble/Core/Notifications.swift +++ b/ios/Crumble/Core/Notifications.swift @@ -117,7 +117,6 @@ final class Notifier: NSObject, UNUserNotificationCenterDelegate { private var tapRouter = NotificationTapRouter() private var history = NotificationHistory(keys: UserDefaults.standard.stringArray(forKey: "push.seen") ?? []) private var started = false - private var backgroundTask = UIBackgroundTaskIdentifier.invalid func start(model: AppModel) { self.model = model @@ -129,13 +128,13 @@ final class Notifier: NSObject, UNUserNotificationCenterDelegate { started = true push.didUpdate = { [weak self] in self?.routePendingTap() } connectionChanged() + setForeground(UIApplication.shared.applicationState == .active) refreshAuthorization(requestIfNeeded: true) } func connectionChanged() { guard started else { return } push.setConnection(model?.client) - updatePresence() } /// Unregisters this device while the session still works, before it's signed out. @@ -166,29 +165,9 @@ final class Notifier: NSObject, UNUserNotificationCenterDelegate { } } - func updatePresence(active: Bool? = nil) { + func setForeground(_ active: Bool) { guard started else { return } - let isActive = active ?? (UIApplication.shared.applicationState == .active) - let agentID: String? = if case .agent(let id) = model?.route { id } else { nil } - push.setPresence(active: isActive, agentID: agentID) - if !isActive, backgroundTask == .invalid { - // A finite grace period lets the presence update finish as iOS suspends the app. - backgroundTask = UIApplication.shared.beginBackgroundTask( - withName: "Update notification presence" - ) { [weak self] in - Task { @MainActor in self?.finishPresenceUpdate() } - } - Task { - await push.waitForSync() - finishPresenceUpdate() - } - } - } - - private func finishPresenceUpdate() { - guard backgroundTask != .invalid else { return } - UIApplication.shared.endBackgroundTask(backgroundTask) - backgroundTask = .invalid + push.setForeground(active) } func routePendingTap() { diff --git a/ios/Crumble/Core/PushNotifications.swift b/ios/Crumble/Core/PushNotifications.swift index c6aed16..32ed8d6 100644 --- a/ios/Crumble/Core/PushNotifications.swift +++ b/ios/Crumble/Core/PushNotifications.swift @@ -41,8 +41,6 @@ final class PushController { private let bundleID: String private let environment: String private var client: APIClient? - private var active = false - private var agentID: String? private var revision = 0 private var worker: Task? private var heartbeat: Task? @@ -128,9 +126,8 @@ final class PushController { status = "APNs registration failed. Check signing and network access; retry on return to the app." } - func setPresence(active: Bool, agentID: String?) { - self.active = active - self.agentID = active ? agentID : nil + /// While the app is in the foreground, registration and pending cleanup retry every 30 seconds. + func setForeground(_ active: Bool) { heartbeat?.cancel() heartbeat = nil if active { @@ -248,8 +245,6 @@ final class PushController { status = response.remoteDelivery ? "Push notifications are ready." : "Server push delivery is not configured. Alerts work while the app is open." - try await client.pushPresence( - installationID, active: active, agentId: active ? agentID : nil) } catch { guard version == revision else { return } status = "Push setup could not reach the server. It will retry when the app is active." diff --git a/ios/Crumble/CrumbleApp.swift b/ios/Crumble/CrumbleApp.swift index 435ebc6..1ea79d8 100644 --- a/ios/Crumble/CrumbleApp.swift +++ b/ios/Crumble/CrumbleApp.swift @@ -26,19 +26,17 @@ struct CrumbleApp: App { model.followActivity() } } - .onChange(of: model.route) { _, _ in - Notifier.shared.updatePresence() - model.markChatSeen() - } + .onChange(of: model.route) { _, _ in model.markChatSeen() } + .onChange(of: scenePhase, initial: true) { _, phase in model.setSceneActive(phase == .active) } .onChange(of: scenePhase) { _, phase in guard started else { return } if phase == .background { - Notifier.shared.updatePresence(active: false) + Notifier.shared.setForeground(false) model.suspendStreams() } if phase == .active { Notifier.shared.refreshAuthorization() - Notifier.shared.updatePresence(active: true) + Notifier.shared.setForeground(true) model.markChatSeen() if model.client?.token.isEmpty == false { model.resumeStreams() } } diff --git a/ios/Crumble/Views/AgentEditorView.swift b/ios/Crumble/Views/AgentEditorView.swift index c06730e..5cdc213 100644 --- a/ios/Crumble/Views/AgentEditorView.swift +++ b/ios/Crumble/Views/AgentEditorView.swift @@ -175,7 +175,8 @@ extension AgentEditorView { private var inferenceSection: some View { Section { ReasoningField( - levels: ThinkingLevel.available(for: draft.model, in: model.models), thinking: $draft.thinking) + preview: model.reasoningBoard.preview(provider: draft.provider, model: draft.model, level: draft.thinking), + thinking: $draft.thinking) LabeledContent("Temperature") { TextField("Optional, 0–2", text: $draft.temperature) .labelsHidden() @@ -205,6 +206,11 @@ extension AgentEditorView { ) .foregroundStyle(.secondary) } + .task(id: [draft.provider, draft.model, draft.thinking]) { + guard let client = model.client else { return } + await model.reasoningBoard.load( + provider: draft.provider, model: draft.model, level: draft.thinking, client: client) + } } @ViewBuilder private var desktopPreviewSection: some View { diff --git a/ios/Crumble/Views/AutomationsPanel.swift b/ios/Crumble/Views/AutomationsPanel.swift index 1926e86..e613c1d 100644 --- a/ios/Crumble/Views/AutomationsPanel.swift +++ b/ios/Crumble/Views/AutomationsPanel.swift @@ -7,8 +7,7 @@ struct AutomationsPanel: View { var body: some View { AutomationsPage( - board: model.automationBoard, agents: model.agents, - sources: model.connectedServices.eventSources.sources, client: model.client, + board: model.automationBoard, agents: model.agents, client: model.client, onCreate: model.openNewAutomation, onRun: model.runAutomation, onOpenBot: { model.selectAgent($0) }) } } diff --git a/ios/Crumble/Views/ChatAttachments.swift b/ios/Crumble/Views/ChatAttachments.swift index b573cbe..bb11442 100644 --- a/ios/Crumble/Views/ChatAttachments.swift +++ b/ios/Crumble/Views/ChatAttachments.swift @@ -31,7 +31,8 @@ struct PendingAttachmentChip: View { } } -/// The files a sent message carries: image thumbnails loaded from the server, text files by name. +/// The files a sent message carries: image thumbnails loaded from the server, other files by name, and a +/// placeholder for a file deleted from the chat's library. struct SentAttachments: View { @Environment(AppModel.self) private var model let message: Message @@ -60,7 +61,7 @@ struct SentAttachments: View { } } } else { - FileLabel(name: file.name) + FileLabel(name: file.deleted ? "File deleted" : file.name) } } } diff --git a/ios/Crumble/Views/ChatView.swift b/ios/Crumble/Views/ChatView.swift index 60263eb..7338fdf 100644 --- a/ios/Crumble/Views/ChatView.swift +++ b/ios/Crumble/Views/ChatView.swift @@ -29,15 +29,13 @@ enum ChatRow: Identifiable { var rows: [ChatRow] = hasMore ? [.older] : [] var last: Int64 = 0 let reactions = Reaction.byMessage(messages) - let sources = SourceCitations.byReply(messages) - for var message in messages where shownInChat(message) { + for message in messages where shownInChat(message) { if let timestamp = message.timestamp, timestamp > 0 { if timestamp - last > 30 * 60 * 1000 { rows.append(.time(message.id, timeLabel(Date(timeIntervalSince1970: Double(timestamp) / 1000)))) } last = timestamp } - message.sources = sources[message.id] rows.append(.message(message, reactions: reactions[message.id] ?? [])) } if let snapshot { @@ -83,6 +81,7 @@ struct ChatView: View { .defaultScrollAnchor(.bottom, for: .sizeChanges) .jumpToLatest() .keepsContentSwipe() + .chatAttention(.bot(agent.id), ready: model.snapshot != nil) .overlay { if rows.isEmpty { EmptyChatView(agent: agent) } } @@ -221,7 +220,7 @@ struct ChatRowView: View { case .thinking: HStack(spacing: 8) { TypingBubble() - Text(Working(snapshot: model.snapshot, messages: model.messages).label + "…") + Text((model.snapshot?.working ?? .thinking).label + "…") .font(.caption) .foregroundStyle(.secondary) Spacer() diff --git a/ios/Crumble/Views/DetailsPanel.swift b/ios/Crumble/Views/DetailsPanel.swift index aa6f842..628f5d7 100644 --- a/ios/Crumble/Views/DetailsPanel.swift +++ b/ios/Crumble/Views/DetailsPanel.swift @@ -71,7 +71,7 @@ struct DetailsPanel: View { Label { VStack(alignment: .leading, spacing: 2) { Text(schedule.name).lineLimit(1) - Text(automationTiming(schedule, sources: model.connectedServices.eventSources.sources)) + Text(schedule.timing) .font(.subheadline) .foregroundStyle(.secondary) if let error = board.errors[schedule.id] { Text(error).font(.subheadline).foregroundStyle(.red) } diff --git a/ios/Crumble/Views/GroupChatViews.swift b/ios/Crumble/Views/GroupChatViews.swift index ff9e987..18bb8a8 100644 --- a/ios/Crumble/Views/GroupChatViews.swift +++ b/ios/Crumble/Views/GroupChatViews.swift @@ -93,6 +93,7 @@ struct GroupChatView: View { .defaultScrollAnchor(.bottom, for: .sizeChanges) .jumpToLatest() .keepsContentSwipe() + .chatAttention(.group(group.id), ready: model.groupSnapshot != nil) .overlay { if rows.isEmpty { if model.groupSnapshot == nil { @@ -262,10 +263,10 @@ struct GroupBotMessage: View { } private var bubble: some View { - let reply = SourceCitations.split(message.text, sources: message.sources ?? []) - return VStack(alignment: .leading, spacing: 6) { - MarkdownText(text: reply.text).textSelection(.enabled) - ForEach(reply.chips, id: \.href) { SourceChipLink(chip: $0) } + VStack(alignment: .leading, spacing: 6) { + MarkdownText(text: message.presentedText).textSelection(.enabled) + .replySurface(message, .text, ready: message.showsReplyText) + ForEach(message.citations, id: \.href) { CitationLink(citation: $0) } } .bubble(owner: false, tail: place.endsRun) .fixedSize(horizontal: false, vertical: true) @@ -282,14 +283,14 @@ struct GroupBotMessage: View { } } -/// A page the reply's turn read, opened in the browser. -struct SourceChipLink: View { - let chip: SourceChip +/// A page the reply cited, opened in the browser. +struct CitationLink: View { + let citation: Citation var body: some View { - if let url = URL(string: chip.href) { + if let url = URL(string: citation.href) { Link(destination: url) { - Label(chip.title.nilIfEmpty ?? chip.href, systemImage: "link") + Label(citation.title.nilIfEmpty ?? citation.site, systemImage: "link") .font(.callout).lineLimit(1) } } diff --git a/ios/Crumble/Views/JobViews.swift b/ios/Crumble/Views/JobViews.swift index 8e08a2a..d0a86e4 100644 --- a/ios/Crumble/Views/JobViews.swift +++ b/ios/Crumble/Views/JobViews.swift @@ -172,7 +172,7 @@ struct JobSheet: View { @State private var desktop: BotDesktopTarget? let job: JobHistory - private var items: [CodingJobItem] { CodingJobItem.items(from: job.messages) } + private var items: [JobHistoryItem] { job.items } private var current: Job? { model.jobs[Job.id(job.kind, job.name)] } private var working: Bool { current?.isWorking ?? false } private var exporting: Binding { @@ -251,7 +251,7 @@ struct JobSheet: View { .textSelection(.enabled) } ForEach(items) { item in - CodingJobItemView(item: item) + JobItemView(item: item) } if working && job.loaded { HStack(spacing: 6) { @@ -285,70 +285,60 @@ struct JobSheet: View { } } -private struct CodingJobItemView: View { - let item: CodingJobItem +private struct JobItemView: View { + let item: JobHistoryItem var body: some View { switch item { - case .task(_, let text): + case .task(let task): VStack(alignment: .leading, spacing: 4) { Text("Task").font(.caption).foregroundStyle(.secondary) - Text(text) + Text(task.text) .textSelection(.enabled) .padding(.horizontal, 14) .padding(.vertical, 10) .background(Color.accentColor.opacity(0.12), in: .rect(cornerRadius: 14)) } .accessibilityElement(children: .combine) - case .reply(_, let text): - MarkdownText(text: text) + case .reply(let reply): + MarkdownText(text: reply.text) .textSelection(.enabled) .frame(maxWidth: .infinity, alignment: .leading) - case .tool(let tool): - CodingToolStep(tool: tool) + case .step(let step): + JobStepView(step: step) } } } -/// One tool call: what ran (a command or a file). Tap it to see the whole output, which a phone -/// has no room to show for every step. -private struct CodingToolStep: View { - let tool: CodingJobItem.Tool +/// One tool call: what ran (a command or a file), as the server labels it. Tap it to see the whole output, +/// which a phone has no room to show for every step. +private struct JobStepView: View { + let step: JobStepItem @State private var open = false private var icon: String { - switch tool.name { - case "bash": "terminal" - case "read": "doc.text" - case "write": "square.and.pencil" - case "edit": "pencil" - case "computer_use": JobKind.desktop.icon - default: "wrench.and.screwdriver" + switch step.icon { + case .terminal: "terminal" + case .file: "doc.text" + case .pencil: "pencil" + case .pointer: JobKind.desktop.icon + case .tool: "wrench.and.screwdriver" } } - private var verb: String { - switch tool.name { - case "bash": "Ran" - case "read": "Read" - case "write": "Wrote" - case "edit": "Edited" - case "computer_use": "Used the bot desktop" - default: tool.name.capitalized - } - } + private var subject: String { step.subject ?? "" } private var summary: some View { Button { open.toggle() } label: { HStack(alignment: .firstTextBaseline, spacing: 8) { - Image(systemName: tool.isError ? "exclamationmark.triangle.fill" : icon) - .foregroundStyle(tool.isError ? .red : .secondary) + Image(systemName: step.isError ? "exclamationmark.triangle.fill" : icon) + .foregroundStyle(step.isError ? .red : .secondary) .frame(width: 18) - Text(verb).foregroundStyle(.secondary) - Text(tool.subject).font(.caption.monospaced()).lineLimit(open ? nil : 2) - if !tool.finished { ProgressView().controlSize(.mini) } + Text(step.label).foregroundStyle(.secondary) + Text(subject).font(.caption.monospaced()).lineLimit(open ? nil : 2) + if !step.finished { ProgressView().controlSize(.mini) } Spacer(minLength: 0) } .font(.callout) @@ -356,8 +346,8 @@ private struct CodingToolStep: View { .contentShape(Rectangle()) } .buttonStyle(.plain) - .disabled(!tool.finished) - .accessibilityLabel("\(verb) \(tool.subject)\(tool.isError ? ", failed" : "")") + .disabled(!step.finished) + .accessibilityLabel("\(step.label) \(subject)\(step.isError ? ", failed" : "")") .accessibilityValue(open ? "Expanded" : "Collapsed") } @@ -365,9 +355,9 @@ private struct CodingToolStep: View { VStack(alignment: .leading, spacing: 6) { summary if open { - Text(tool.shownOutput) + Text(step.shownOutput) .font(.caption.monospaced()) - .foregroundStyle(tool.isError ? Color.red : Color.primary) + .foregroundStyle(step.isError ? Color.red : Color.primary) .textSelection(.enabled) .padding(10) .frame(maxWidth: .infinity, alignment: .leading) diff --git a/ios/Crumble/Views/MessageView.swift b/ios/Crumble/Views/MessageView.swift index 9de5ce9..6d4050e 100644 --- a/ios/Crumble/Views/MessageView.swift +++ b/ios/Crumble/Views/MessageView.swift @@ -36,7 +36,7 @@ struct MessageView: View { } } else if message.kind == HeldActionEvent.messageKind, let held = message.heldAction { HStack { - HeldActionCard(held: held, title: message.text) + HeldActionCard(held: held, title: message.text).replyCard(message) Spacer(minLength: 24) } } else if let failure = JobFailure(message: message) { @@ -64,17 +64,17 @@ struct MessageView: View { } } else if let request = BotRequest(message: message) { HStack { - BotRequestCard(request: request) + BotRequestCard(request: request).replyCard(message) Spacer(minLength: 24) } } else if let request = CallRequest(message: message) { HStack { - CallRequestCard(request: request) + CallRequestCard(request: request).replyCard(message) Spacer(minLength: 24) } } else if let ask = BotSecretAsk(message: message) { HStack { - BotSecretRequestCard(ask: ask) + BotSecretRequestCard(ask: ask).replyCard(message) Spacer(minLength: 24) } } @@ -154,10 +154,10 @@ struct MessageView: View { } private var incomingMessageContent: some View { - let reply = SourceCitations.split(message.text, sources: message.sources ?? []) - return VStack(alignment: .leading, spacing: 6) { - MarkdownText(text: reply.text).textSelection(.enabled) - ForEach(reply.chips, id: \.href) { SourceChipLink(chip: $0) } + VStack(alignment: .leading, spacing: 6) { + MarkdownText(text: message.presentedText).textSelection(.enabled) + .replySurface(message, .text, ready: message.showsReplyText) + ForEach(message.citations, id: \.href) { CitationLink(citation: $0) } } .bubble(owner: false, tail: place.endsRun) .contextMenu { menu } diff --git a/ios/Crumble/Views/ReplyAttention.swift b/ios/Crumble/Views/ReplyAttention.swift new file mode 100644 index 0000000..e374894 --- /dev/null +++ b/ios/Crumble/Views/ReplyAttention.swift @@ -0,0 +1,106 @@ +import apfelkern +import SwiftUI + +extension EnvironmentValues { + /// The chat whose transcript a view sits in, for its reply surfaces. + @Entry var attentionChat: ChatAttentionChat? +} + +extension View { + /// Mounts the chat while its transcript shows, and reports what covers its scroll view's edges. + /// Apply to the chat's scroll view. + func chatAttention(_ chat: ChatAttentionChat, ready: Bool) -> some View { + modifier(ChatAttentionMount(chat: chat, ready: ready)) + } + + /// Acknowledges the message's replies on this exact surface once it's ready and on screen. + func replySurface(_ message: Message, _ surface: ReplySurface, ready: Bool) -> some View { + modifier(ReplySurfaceReport( + key: "\(message.id) \(surface)", eventIDs: message.attentionEventIDs(for: surface), ready: ready)) + } + + /// Acknowledges a waiting card once its board has the server's state for it and it's on screen. + func replyCard(_ message: Message) -> some View { + modifier(ReplyCardReport(message: message)) + } +} + +private struct ChatAttentionMount: ViewModifier { + @Environment(AppModel.self) private var model + let chat: ChatAttentionChat + let ready: Bool + + func body(content: Content) -> some View { + content + .environment(\.attentionChat, chat) + .onScrollGeometryChange(for: EdgeInsets.self) { $0.contentInsets } action: { _, insets in + model.chatAttention.setViewportInsets(top: insets.top, bottom: insets.bottom) + } + // A view can stay while the owner picks another chat, so the chat itself can change. + .onChange(of: ready ? chat : nil, initial: true) { old, new in + if let old, old != new { model.chatAttention.unmount(old) } + if let new { model.chatAttention.mount(new) } + } + .onAppear { if ready { model.chatAttention.mount(chat) } } + .onDisappear { model.chatAttention.unmount(chat) } + } +} + +private struct ReplyCardReport: ViewModifier { + @Environment(AppModel.self) private var model + let message: Message + + func body(content: Content) -> some View { + let card = message.replyCard( + heldActions: model.heldActionBoard, botRequests: model.botRequestBoard, + callRequests: model.callRequestBoard, botSecrets: model.botSecretBoard) + content.modifier(ReplySurfaceReport( + key: "\(message.id) card", eventIDs: card.map { message.attentionEventIDs(for: $0.surface) } ?? [], + ready: card?.ready ?? false)) + } +} + +/// Reports a surface's frame in its scroll view while it has replies to acknowledge. The policy of what counts +/// as seen lives in `ChatAttention`. +private struct ReplySurfaceReport: ViewModifier { + struct Placement: Equatable { + var frame: CGRect + var container: CGSize + } + + private struct Report: Equatable { + var chat: ChatAttentionChat? + var placement: Placement? + var eventIDs: [String] + var ready: Bool + } + + @Environment(AppModel.self) private var model + @Environment(\.attentionChat) private var chat + let key: String + let eventIDs: [String] + let ready: Bool + @State private var placement: Placement? + + func body(content: Content) -> some View { + content + .onGeometryChange(for: Placement?.self) { [eventIDs] proxy in + guard !eventIDs.isEmpty, let scroll = proxy.bounds(of: .scrollView) else { return nil } + return Placement(frame: proxy.frame(in: .scrollView), container: scroll.size) + } action: { placement = $0 } + .onChange( + of: Report(chat: chat, placement: placement, eventIDs: eventIDs, ready: ready), initial: true + ) { _, report in + guard let chat = report.chat else { return } + guard let placement = report.placement, !report.eventIDs.isEmpty else { + return model.chatAttention.removeSurface(key, of: chat) + } + model.chatAttention.setSurface( + key, of: chat, frame: placement.frame, container: placement.container, + eventIDs: report.eventIDs, ready: report.ready) + } + .onDisappear { + if let chat { model.chatAttention.removeSurface(key, of: chat) } + } + } +} diff --git a/ios/Crumble/Views/WorkspaceForms.swift b/ios/Crumble/Views/WorkspaceForms.swift index 8c6beaf..01632a0 100644 --- a/ios/Crumble/Views/WorkspaceForms.swift +++ b/ios/Crumble/Views/WorkspaceForms.swift @@ -70,14 +70,16 @@ struct AutomationFormView: View { draft: $draft, agents: model.agents, capabilities: model.capabilities, sources: model.connectedServices.eventSources.sources, sourcesLoaded: model.connectedServices.eventSources.isLoaded, - eventRelayURL: model.client?.webSettingsURL(.eventRelay)) + eventRelayURL: model.client?.webSettingsURL(.eventRelay), + preview: model.automationBoard.draftPreview, loadPreview: model.loadAutomationPreview) } .formStyle(.grouped) .navigationTitle(draft.isNew ? "New Automation" : "Edit Automation") .navigationBarTitleDisplayMode(.inline) .toolbar { SheetActions( - onCancel: model.automationBoard.closeDraft, onSave: model.saveAutomation, saveDisabled: false) + onCancel: model.automationBoard.closeDraft, onSave: model.saveAutomation, + saveDisabled: model.automationBoard.draftPreviewProblem != nil) } } } diff --git a/ios/CrumbleTests/AppModelLifecycleTests.swift b/ios/CrumbleTests/AppModelLifecycleTests.swift index 7838784..0d17bae 100644 --- a/ios/CrumbleTests/AppModelLifecycleTests.swift +++ b/ios/CrumbleTests/AppModelLifecycleTests.swift @@ -12,7 +12,7 @@ extension APIClientTests { ( 200, ContractFixtures.snapshot("a1", messages: [ - .init(content: "ready", entryId: "a1:1", id: "a1:1:0", role: "assistant") + .init(content: "ready", entryId: "a1:1", id: "a1:1:0", replyReferences: [], role: "assistant") ]) ) case "/v1/events", "/v1/agents/a1/events": (401, "") diff --git a/ios/CrumbleTests/CallRequestTests.swift b/ios/CrumbleTests/CallRequestTests.swift index d5a2214..909f810 100644 --- a/ios/CrumbleTests/CallRequestTests.swift +++ b/ios/CrumbleTests/CallRequestTests.swift @@ -13,8 +13,8 @@ extension APIClientTests { } private static let spoken = - #"{"messages":[{"id":"1","entryId":"e1","role":"user","content":"Hello?"},"# - + #"{"id":"2","entryId":"e2","role":"assistant","content":"Good day.","# + #"{"messages":[{"id":"1","entryId":"e1","replyReferences":[],"role":"user","content":"Hello?"},"# + + #"{"id":"2","entryId":"e2","replyReferences":[],"role":"assistant","content":"Good day.","# + #""blocks":[{"type":"text","text":"Good day."}]}],"# + #""hasMore":false,"oldestEntryId":null}"# diff --git a/ios/CrumbleTests/ChatAttentionTests.swift b/ios/CrumbleTests/ChatAttentionTests.swift new file mode 100644 index 0000000..d392fa4 --- /dev/null +++ b/ios/CrumbleTests/ChatAttentionTests.swift @@ -0,0 +1,88 @@ +import apfelkern +import Foundation +import Testing + +@testable import Crumble + +private func attentionChat(_ request: URLRequest) -> JSONValue? { + guard let body = request.httpBody, + case .object(let fields) = try? JSONDecoder().decode(JSONValue.self, from: body) + else { return nil } + return fields["chat"] +} + +private func reportedChat(_ kind: String, _ id: String) -> JSONValue { + .object(["kind": .string(kind), "id": .string(id)]) +} + +private let referencedReply = #"{"agentId":"a1","status":"idle","working":"idle","partial":"","updatedAt":0,"# + + #""error":null,"hasMore":false,"oldestEntryId":null,"conversationId":"c1","# + + #""conversation":{"id":"c1","agentId":"a1","title":"Chat","createdAt":"now","updatedAt":"now"},"# + + #""messages":[{"id":"a1:2:0","entryId":"a1:2","role":"assistant","content":"Done","# + + #""replyReferences":[{"eventId":"reply-event","surface":{"kind":"text"}}]}]}"# + +@MainActor +private func eventually(_ done: () -> Bool) async -> Bool { + for _ in 0..<300 where !done() { try? await Task.sleep(for: .milliseconds(10)) } + return done() +} + +extension APIClientTests { + @MainActor @Test func theActiveSceneReportsItsChatWithoutPushAndClearsBeforeSignOut() async throws { + let client = StubProtocol.client(token: "session") { _ in (204, "") } + let model = AppModel(client: client) + let presence = { + StubProtocol.requests.filter { $0.url?.path.hasPrefix("/v1/chat-attention/views/") == true } + } + model.route = .agent("a1") + model.setSceneActive(true) + try await Task.sleep(for: .milliseconds(50)) + #expect(presence().isEmpty) + + // The chat's view mounts once its transcript shows. + model.chatAttention.mount(.bot("a1")) + #expect(await eventually { presence().count == 1 }) + #expect(attentionChat(presence()[0]) == reportedChat("bot", "a1")) + + model.setSceneActive(false) + #expect(await eventually { presence().count == 2 }) + #expect(attentionChat(presence()[1]) == .null) + + model.setSceneActive(true) + model.route = .group("g1") + model.chatAttention.mount(.group("g1")) + #expect(await eventually { presence().last.flatMap(attentionChat) == reportedChat("group", "g1") }) + #expect(!StubProtocol.requests.contains { $0.url?.path.hasPrefix("/v1/push") == true }) + + model.signOut() + #expect(await eventually { model.client?.token.isEmpty == true }) + let last = try #require(presence().last) + #expect(attentionChat(last) == .null) + #expect(last.value(forHTTPHeaderField: "Authorization") == "Bearer session") + } + + @MainActor @Test func aLiveReplyReloadsTheOpenChatAndKeepsTheDraft() async throws { + let client = StubProtocol.client(token: "session") { request in + request.url?.path == "/v1/agents/a1/chat" ? (200, referencedReply) : (204, "") + } + let model = AppModel(client: client) + let reads = { StubProtocol.requests.filter { $0.url?.path == "/v1/agents/a1/chat" }.count } + model.updateSelectedAgent("a1") + model.route = .agent("a1") + model.messages = [Message(id: "a1:1:0", entryId: "a1:1", role: "user", content: .string("Hi"))] + model.draft = "Keep this" + let reply = ActivityEvent(eventId: "reply-event", type: "reply", agentId: "a1", agentName: "Atlas") + + model.handleActivity(reply) + try await Task.sleep(for: .milliseconds(50)) + #expect(reads() == 0) + + model.setSceneActive(true) + model.handleActivity(reply) + #expect(await eventually { model.messages.count == 2 }) + #expect(reads() == 1) + #expect(model.messages.last?.attentionEventIDs(for: .text) == ["reply-event"]) + #expect(model.messages.first?.text == "Hi") + #expect(model.draft == "Keep this") + } +} diff --git a/ios/CrumbleTests/ContractFixtures.swift b/ios/CrumbleTests/ContractFixtures.swift index a0850a0..f433543 100644 --- a/ios/CrumbleTests/ContractFixtures.swift +++ b/ios/CrumbleTests/ContractFixtures.swift @@ -47,7 +47,7 @@ enum ContractFixtures { value2: .init(agentId: agentID, conversation: .init( agentId: agentID, createdAt: timestamp, id: "conversation-\(agentID)", title: "Chat", updatedAt: timestamp), conversationId: "conversation-\(agentID)", partial: "", - status: status, updatedAt: 0))) + status: status, updatedAt: 0, working: status == .running ? .thinking : .idle))) } static func execution(_ agentID: String = "a1", requestID: String = requestID) -> String { diff --git a/ios/CrumbleTests/ControlledDeliveryProtocol.swift b/ios/CrumbleTests/ControlledDeliveryProtocol.swift index fc1045a..21820fe 100644 --- a/ios/CrumbleTests/ControlledDeliveryProtocol.swift +++ b/ios/CrumbleTests/ControlledDeliveryProtocol.swift @@ -114,10 +114,13 @@ extension ControlledDeliveryController { return false } - func release(_ path: String, body: String) { + func release(_ path: String, body: String, status: Int = 200) { + release(path, data: Data(body.utf8), status: status) + } + + func release(_ path: String, data: Data, status: Int = 200) { heldPaths.remove(path) - heldRequests.removeValue(forKey: path)?.resume( - returning: ControlledHTTPResponse(status: 200, body: Data(body.utf8))) + heldRequests.removeValue(forKey: path)?.resume(returning: ControlledHTTPResponse(status: status, body: data)) } } diff --git a/ios/CrumbleTests/CrumbleTests.swift b/ios/CrumbleTests/CrumbleTests.swift index a67121b..ba1cd23 100644 --- a/ios/CrumbleTests/CrumbleTests.swift +++ b/ios/CrumbleTests/CrumbleTests.swift @@ -11,6 +11,8 @@ import UniformTypeIdentifiers final class StubProtocol: URLProtocol, @unchecked Sendable { nonisolated(unsafe) static var handler: ((URLRequest) -> (Int, String))? nonisolated(unsafe) static var requests: [URLRequest] = [] + /// Binary bodies by path, such as file downloads, served with status 200 ahead of the handler. + nonisolated(unsafe) static var files: [String: Data] = [:] nonisolated(unsafe) private static var sessionID = "" override static func canInit(with request: URLRequest) -> Bool { true } @@ -34,7 +36,9 @@ final class StubProtocol: URLProtocol, @unchecked Sendable { // next session's handler and request log instead of reusing its canned responses. let current = recorded.value(forHTTPHeaderField: "X-Crumble-Test-Session") == Self.sessionID if current { Self.requests.append(recorded) } - let (status, body) = current ? Self.handler?(recorded) ?? (404, "") : (401, "") + let file = current ? request.url.flatMap { Self.files[$0.path] } : nil + let (status, body) = file.map { _ in (200, "") } + ?? (current ? Self.handler?(recorded) ?? (404, "") : (401, "")) guard let url = request.url, let response = HTTPURLResponse( url: url, statusCode: status, httpVersion: "HTTP/1.1", headerFields: nil) @@ -44,7 +48,7 @@ final class StubProtocol: URLProtocol, @unchecked Sendable { return } client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) - client?.urlProtocol(self, didLoad: Data(body.utf8)) + client?.urlProtocol(self, didLoad: file ?? Data(body.utf8)) client?.urlProtocolDidFinishLoading(self) } @@ -54,6 +58,7 @@ final class StubProtocol: URLProtocol, @unchecked Sendable { -> APIClient { self.handler = handler requests = [] + files = [:] let configuration = URLSessionConfiguration.ephemeral sessionID = UUID().uuidString configuration.httpAdditionalHeaders = ["X-Crumble-Test-Session": sessionID] @@ -158,7 +163,8 @@ struct APIClientTests { ( 200, ContractFixtures.json(Components.Schemas.TranscriptPage( - hasMore: false, messages: [.init(content: "older", entryId: "a1:8", id: "a1:8:0", role: "user")], + hasMore: false, + messages: [.init(content: "older", entryId: "a1:8", id: "a1:8:0", replyReferences: [], role: "user")], oldestEntryId: "a1:8")) ) case "/v1/agents/a1/messages": (202, ContractFixtures.execution()) @@ -178,24 +184,18 @@ struct APIClientTests { #expect(body.replyTo == "a1:41") } - @Test func messagesCarryAttachments() async throws { + @Test func messagesCarryFileIDs() async throws { let client = StubProtocol.client { _ in (202, ContractFixtures.execution()) } try await client.sendChatMessage( - "a1", content: "", requestID: ContractFixtures.requestID, replyTo: "", - attachments: [OutgoingAttachment(name: "dot.png", mimeType: "image/png", data: "AAAA")]) + "a1", content: "", requestID: ContractFixtures.requestID, replyTo: "", files: ["f1"]) let body = try JSONDecoder().decode( Operations.SendMessage.Input.Body.JsonPayload.self, from: try #require(StubProtocol.requests.last?.httpBody)) #expect(body.replyTo == nil) - #expect(body.attachments?.first?.mimeType == "image/png") - let message = try JSONDecoder().decode( - Message.self, - from: Data( - #""" - {"id":"a1:5:0","role":"user","content":"", - "attachments":[{"name":"dot.png","mimeType":"image/png","size":70,"kind":"image"}]} - """# - .utf8)) + #expect(body.files == ["f1"]) + let message = Message( + id: "a1:5:0", role: "user", content: .string(""), + attachments: [AttachmentInfo(id: "f1", name: "dot.png", mimeType: "image/png", size: 70)]) #expect(message.attachments?.first?.isImage == true) #expect(shownInChat(message)) } diff --git a/ios/CrumbleTests/FileCompatibilityTests.swift b/ios/CrumbleTests/FileCompatibilityTests.swift new file mode 100644 index 0000000..def32e0 --- /dev/null +++ b/ios/CrumbleTests/FileCompatibilityTests.swift @@ -0,0 +1,249 @@ +import apfelkern +import UIKit +import Foundation +import Testing + +@testable import Crumble + +private func uploadFixture(_ id: String) -> String { + #"{"file":{"id":"\#(id)","name":"file","mimeType":"text/plain","size":2,"createdAt":"now"},"existed":false}"# +} + +private func pngData() -> Data { + UIGraphicsImageRenderer(size: CGSize(width: 1, height: 1)).pngData { context in + UIColor.red.setFill() + context.fill(CGRect(x: 0, y: 0, width: 1, height: 1)) + } +} + +private func imageMessage(_ entry: String, file: AttachmentInfo) -> Message { + Message(id: "a1:\(entry):0", entryId: "a1:\(entry)", role: "user", attachments: [file]) +} + +private let dot = AttachmentInfo(id: "f1", name: "dot.png", mimeType: "image/png", size: 70) + +private let tripFixture = """ + {"groupChat":{"id":"trip","name":"Trip","memberIds":["a1","a2"],"createdAt":"now","updatedAt":"now"}, + "activity":{"paused":false,"botTurns":0,"members":[]}, + "messages":[{"id":"trip:1:0","entryId":"trip:1","replyReferences":[],"role":"user","content":"Map", + "files":[{"id":"g1","name":"map.png","mimeType":"image/png","size":70}]}], + "hasMore":false,"oldestEntryId":"trip:1","updatedAt":1} + """ + +/// Attachments upload before their message and are fetched by file ID, as the current server contract requires. +extension APIClientTests { + @MainActor private func waitFor(_ condition: () -> Bool) async { + for _ in 0..<200 { + if condition() { return } + try? await Task.sleep(for: .milliseconds(10)) + } + } + + private func requests(_ path: String) -> [URLRequest] { + StubProtocol.requests.filter { $0.url?.path == path } + } + + private func bodies(_ path: String) -> [JSONValue] { + requests(path).compactMap { $0.httpBody }.compactMap { try? JSONDecoder().decode(JSONValue.self, from: $0) } + } + + @MainActor private func botChat(handler: @escaping (URLRequest) -> (Int, String)) async -> AppModel { + let model = AppModel(client: StubProtocol.client { request in + request.url?.path == "/v1/agents/a1/chat" ? (200, ContractFixtures.snapshot("a1")) : handler(request) + }) + model.selectAgent("a1") + await waitFor { model.snapshot != nil } + return model + } + + @MainActor @Test func botSendsUploadRawBytesThenCarryFileIDs() async { + let model = await botChat { request in + switch request.url?.path { + case "/v1/agents/a1/files": (201, uploadFixture("f1")) + case "/v1/agents/a1/messages": (202, ContractFixtures.execution()) + default: (404, "") + } + } + defer { model.cancelStream() } + model.draft = "Read this" + model.attachments = [PendingAttachment(name: "notes ü.txt", mimeType: "text/plain", data: Data("hi".utf8))] + await model.sendMessage()?.value + + let upload = requests("/v1/agents/a1/files") + #expect(upload.count == 1) + #expect(upload.first?.value(forHTTPHeaderField: "Content-Type") == "text/plain") + #expect(upload.first?.value(forHTTPHeaderField: "X-File-Name") == "notes%20%C3%BC.txt") + #expect(upload.first?.httpBody == Data("hi".utf8)) + let body = bodies("/v1/agents/a1/messages").first + #expect(body?["files"] == .array([.string("f1")])) + #expect(body?["attachments"] == nil) + #expect(model.messages.last?.deliveryState == .sending) + #expect(model.messages.last?.attachments?.first?.name == "notes ü.txt") + } + + @MainActor @Test func aRetryUploadsOnlyTheFilesAFailedAttemptMissed() async { + var failedOnce = false + let model = await botChat { request in + switch request.url?.path { + case "/v1/agents/a1/files": + let name = request.value(forHTTPHeaderField: "X-File-Name") ?? "" + if name == "b.txt", !failedOnce { + failedOnce = true + return (503, #"{"error":"busy"}"#) + } + return (201, uploadFixture("id-" + name)) + case "/v1/agents/a1/messages": return (202, ContractFixtures.execution()) + default: return (404, "") + } + } + defer { model.cancelStream() } + let files = ["a.txt", "b.txt"].map { PendingAttachment(name: $0, mimeType: "text/plain", data: Data($0.utf8)) } + model.draft = "Both" + model.attachments = files + await model.sendMessage()?.value + guard let failed = model.messages.last, failed.deliveryState == .failed else { + Issue.record("The send should fail on the second upload") + return + } + #expect(requests("/v1/agents/a1/messages").isEmpty) + // Bot failures put the message back in the composer, as before. + #expect(model.draft == "Both") + #expect(model.attachments.map(\.id) == files.map(\.id)) + + model.retryMessage(failed) + await waitFor { !requests("/v1/agents/a1/messages").isEmpty } + let names = requests("/v1/agents/a1/files").compactMap { $0.value(forHTTPHeaderField: "X-File-Name") } + #expect(names == ["a.txt", "b.txt", "b.txt"]) + let body = bodies("/v1/agents/a1/messages").first + #expect(body?["files"] == .array([.string("id-a.txt"), .string("id-b.txt")])) + #expect(body?["requestId"] == .string(failed.requestId ?? "")) + } + + @MainActor @Test func aDeletedFileRejectionUploadsAgainWhileAmbiguousFailuresReuseUploads() async { + var uploads = 0 + var sends = 0 + let model = await botChat { request in + switch request.url?.path { + case "/v1/agents/a1/files": + uploads += 1 + return (201, uploadFixture("f\(uploads)")) + case "/v1/agents/a1/messages": + sends += 1 + switch sends { + case 1: return (503, #"{"error":"busy"}"#) + case 2: return (400, #"{"error":"notes.txt was deleted from the library"}"#) + default: return (202, ContractFixtures.execution()) + } + default: return (404, "") + } + } + defer { model.cancelStream() } + model.attachments = [PendingAttachment(name: "notes.txt", mimeType: "text/plain", data: Data("n".utf8))] + await model.sendMessage()?.value + for attempt in 2...3 { + guard let failed = model.messages.last, failed.deliveryState == .failed else { + Issue.record("Attempt \(attempt - 1) should fail") + return + } + model.retryMessage(failed) + await waitFor { requests("/v1/agents/a1/messages").count == attempt } + } + let sent = bodies("/v1/agents/a1/messages") + #expect(sent.map { $0["files"] } == [ + .array([.string("f1")]), .array([.string("f1")]), .array([.string("f2")]) + ]) + #expect(Set(sent.compactMap { $0["requestId"] }).count == 1) + #expect(requests("/v1/agents/a1/files").map(\.httpBody) == [Data("n".utf8), Data("n".utf8)]) + } + + @MainActor @Test func deletedTranscriptFilesHideCachedImagesAndAreNeverFetched() async { + let model = await botChat { _ in (404, "") } + defer { model.cancelStream() } + StubProtocol.files["/v1/agents/a1/files/f1"] = pngData() + model.applySnapshot(ChatSnapshot(messages: [imageMessage("1", file: dot)], status: "idle", agentId: "a1")) + await model.loadAttachmentImage(entryID: "a1:1", index: 0) + #expect(requests("/v1/agents/a1/files/f1").count == 1) + #expect(model.messages.first.flatMap { model.attachmentImage(message: $0, index: 0) } != nil) + + // A newer message lists the same file as deleted; the older one stops showing it at once. + model.applySnapshot(ChatSnapshot( + messages: [imageMessage("1", file: dot), imageMessage("2", file: .deleted("f1"))], + status: "idle", agentId: "a1")) + #expect(model.messages.map { $0.attachments?.first?.deleted } == [true, true]) + #expect(model.messages.allSatisfy { model.attachmentImage(message: $0, index: 0) == nil }) + await model.loadAttachmentImage(entryID: "a1:1", index: 0) + await model.loadAttachmentImage(entryID: "a1:2", index: 0) + #expect(requests("/v1/agents/a1/files/f1").count == 1) + #expect(!StubProtocol.requests.contains { $0.url?.path.contains("/attachments/") == true }) + } + + @MainActor @Test func aDownloadThatFinishesAfterDeletionIsNotShown() async { + let (client, controller) = ControlledDeliveryProtocol.client() + let model = AppModel(client: client) + defer { model.cancelStream() } + model.selectAgent("a1") + await waitFor { model.snapshot != nil } + model.applySnapshot(ChatSnapshot(messages: [imageMessage("1", file: dot)], status: "idle", agentId: "a1")) + await controller.hold("/v1/agents/a1/files/f1") + let download = Task { await model.loadAttachmentImage(entryID: "a1:1", index: 0) } + #expect(await controller.waitForHeld("/v1/agents/a1/files/f1")) + model.applySnapshot(ChatSnapshot( + messages: [imageMessage("1", file: .deleted("f1"))], status: "idle", agentId: "a1")) + await controller.release("/v1/agents/a1/files/f1", data: pngData()) + await download.value + #expect(model.attachmentImages.isEmpty) + } + + @MainActor @Test func groupAttachmentsUploadToTheGroupAndDownloadByFileID() async { + let model = AppModel(client: StubProtocol.client { request in + switch request.url?.path { + case "/v1/group-chats/trip/chat": (200, tripFixture) + case "/v1/group-chats/trip/events": (200, "") + case "/v1/group-chats/trip/files": (201, uploadFixture("g2")) + case "/v1/group-chats/trip/messages": (201, #"{"requestId":"r","entryId":"trip:2"}"#) + default: (404, "") + } + }) + defer { model.leaveGroup() } + StubProtocol.files["/v1/group-chats/trip/files/g1"] = pngData() + model.selectGroup("trip") + await waitFor { model.groupSnapshot != nil } + await model.loadAttachmentImage(entryID: "trip:1", index: 0) + #expect(requests("/v1/group-chats/trip/files/g1").count == 1) + #expect(model.messages.first.flatMap { model.attachmentImage(message: $0, index: 0) } != nil) + + let route = pngData() + model.attachments = [PendingAttachment(name: "route.png", mimeType: "image/png", data: route)] + model.replyTo = model.messages.first + await model.sendGroupMessage()?.value + #expect(requests("/v1/group-chats/trip/files").first?.httpBody == route) + let body = bodies("/v1/group-chats/trip/messages").first + #expect(body?["files"] == .array([.string("g2")])) + #expect(body?["replyTo"] == .string("trip:1")) + // Until the snapshot confirms it, the row shows the image from the bytes it kept. + #expect(model.messages.last.flatMap { model.attachmentImage(message: $0, index: 0) } != nil) + } + + @MainActor @Test func anUploadFromAPreviousConnectionNeitherSendsNorChangesTheNewOne() async { + let (client, controller) = ControlledDeliveryProtocol.client() + let model = AppModel(client: client) + defer { model.cancelStream() } + model.selectAgent("a1") + await waitFor { model.snapshot != nil } + await controller.hold("/v1/agents/a1/files") + model.attachments = [PendingAttachment(name: "notes.txt", mimeType: "text/plain", data: Data("n".utf8))] + let send = model.sendMessage() + #expect(await controller.waitForHeld("/v1/agents/a1/files")) + + let (next, _) = ControlledDeliveryProtocol.client() + model.applyConnection(next) + model.draft = "On the new server" + await controller.release("/v1/agents/a1/files", body: uploadFixture("f1"), status: 201) + await send?.value + #expect(await controller.observedPostCount() == 0) + #expect(model.messages.isEmpty) + #expect(model.draft == "On the new server") + #expect(model.attachments.isEmpty) + #expect(model.errorText.isEmpty) + } +} diff --git a/ios/CrumbleTests/GroupChatTests.swift b/ios/CrumbleTests/GroupChatTests.swift index c4feec6..54a0f27 100644 --- a/ios/CrumbleTests/GroupChatTests.swift +++ b/ios/CrumbleTests/GroupChatTests.swift @@ -140,7 +140,8 @@ extension APIClientTests { @MainActor @Test func groupStreamStopsInTheBackgroundAndCatchesUpOnReturn() async { let streamed = groupSnapshotFixture.replacingOccurrences( of: #""messages":[]"#, - with: #""messages":[{"id":"trip:1:0","entryId":"trip:1","role":"assistant","content":"From the stream","# + with: #""messages":[{"id":"trip:1:0","entryId":"trip:1","# + + #""replyReferences":[],"role":"assistant","content":"From the stream","# + #""origin":{"kind":"bot","agentId":"a1","name":"Ada"}}]"# ).replacingOccurrences(of: "\n", with: "") let model = AppModel( diff --git a/ios/CrumbleTests/JobTests.swift b/ios/CrumbleTests/JobTests.swift index 3918c87..8f9243f 100644 --- a/ios/CrumbleTests/JobTests.swift +++ b/ios/CrumbleTests/JobTests.swift @@ -62,14 +62,22 @@ extension APIClientTests { let model = AppModel( client: StubProtocol.client { request in request.url?.path == "/v1/agents/a1/coding-jobs/fix/history" - ? (200, #"{"messages":[{"id":"1","entryId":"e1","role":"user","content":"Fix it"}],"# + ? (200, #"{"items":[{"kind":"task","id":"1","text":"Fix it"},"# + + #"{"kind":"step","id":"c1","tool":"bash","label":"Ran","icon":"terminal","subject":"ls"}],"# + + #""messages":[{"id":"1","entryId":"e1","# + + #""replyReferences":[],"role":"user","content":"Fix it"}],"# + #""hasMore":false,"oldestEntryId":null}"#) : (404, "") }) model.updateSelectedAgent("a1") model.openJob(.coding, "fix") await waitFor { model.jobHistory?.loaded == true } - #expect(model.jobHistory?.messages.map(\.text) == ["Fix it"]) + #expect(model.jobHistory?.items.map(\.id) == ["1", "c1"]) + guard case .step(let step)? = model.jobHistory?.items.last else { + Issue.record("The step is missing") + return + } + #expect(step.label == "Ran" && !step.finished) #expect(model.jobPollDelay == .seconds(15)) } diff --git a/ios/CrumbleTests/LogicTests.swift b/ios/CrumbleTests/LogicTests.swift index fdf99dc..a93cee7 100644 --- a/ios/CrumbleTests/LogicTests.swift +++ b/ios/CrumbleTests/LogicTests.swift @@ -68,10 +68,10 @@ struct LogicTests { @Test func chatHidesToolActivity() { let tool = Message( - id: "a1:1:0", role: "assistant", blocks: .array([.object(["type": .string("toolCall")])])) + id: "a1:1:0", role: "assistant", + blocks: [.toolCall(.init(arguments: .init(), id: "c", name: "bash", _type: .toolCall))]) let reply = Message( - id: "a1:1:1", role: "assistant", content: .string("Hi"), - blocks: .array([.object(["type": .string("text"), "text": .string("Hi")])])) + id: "a1:1:1", role: "assistant", content: .string("Hi"), blocks: [.text(.init(text: "Hi", _type: .text))]) #expect(!shownInChat(tool)) #expect(shownInChat(reply)) } diff --git a/ios/CrumbleTests/PushCleanupTests.swift b/ios/CrumbleTests/PushCleanupTests.swift index 1e698c9..78442cd 100644 --- a/ios/CrumbleTests/PushCleanupTests.swift +++ b/ios/CrumbleTests/PushCleanupTests.swift @@ -14,8 +14,6 @@ extension APIClientTests { (200, #"{"serverId":"\#(serverID)","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(installationID)"): remoteDelivery.map { (200, #"{"serverId":"\#(serverID)","remoteDelivery":\#($0)}"#) } ?? (404, "") - case ("PUT", "/v1/push/devices/\(installationID)/presence"): - remoteDelivery == nil ? (404, "") : (204, "") case ("DELETE", "/v1/push/devices/\(installationID)"): (deletionStatus, deletionStatus == 503 ? "busy" : "") default: (404, "") @@ -52,7 +50,7 @@ extension APIClientTests { request, installationID: controller.installationID, serverID: "new", remoteDelivery: false) } - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() #expect(StubProtocol.requests.contains { $0.httpMethod == "PUT" && $0.url?.host == "new.test" }) #expect(!controller.remoteDelivery) @@ -109,7 +107,7 @@ extension APIClientTests { request, installationID: controller.installationID, serverID: "same", remoteDelivery: false) } - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() #expect(!controller.remoteDelivery) } @@ -130,8 +128,6 @@ extension APIClientTests { (200, #"{"serverId":"server-a","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"server-a","remoteDelivery":true}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") case ("DELETE", "/v1/push/devices/\(controller.installationID)"): (204, "") default: (404, "") @@ -147,7 +143,7 @@ extension APIClientTests { #expect(!controller.enabled) #expect(!controller.remoteDelivery) #expect(StubProtocol.requests.contains { $0.httpMethod == "DELETE" }) - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() } @@ -159,8 +155,6 @@ extension APIClientTests { (200, #"{"serverId":"server-a","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"server-a","remoteDelivery":true}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") default: (404, "") } } @@ -196,8 +190,6 @@ extension APIClientTests { (200, #"{"serverId":"server-a","transports":{"apns":false,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"server-a","remoteDelivery":false}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") default: (404, "") } } @@ -207,7 +199,7 @@ extension APIClientTests { await controller.waitForSync() #expect(!controller.remoteDelivery) #expect(controller.status.contains("Alerts work while the app is open")) - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() } diff --git a/ios/CrumbleTests/PushNotificationTests.swift b/ios/CrumbleTests/PushNotificationTests.swift index 0275bfc..3e9bbdd 100644 --- a/ios/CrumbleTests/PushNotificationTests.swift +++ b/ios/CrumbleTests/PushNotificationTests.swift @@ -32,15 +32,14 @@ extension APIClientTests { #expect(StubProtocol.requests.first?.value(forHTTPHeaderField: "Authorization") == "Bearer current") } - @Test func pushAPIUsesWireContractForGetPutDeleteAndPresence() async throws { + @Test func pushAPIUsesWireContractForGetPutAndDelete() async throws { let client = StubProtocol.client(token: "bearer") { request in switch (request.httpMethod, request.url?.path) { case ("GET", "/v1/push"): (200, #"{"serverId":"server-a","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/install-1"): (200, #"{"serverId":"server-a","remoteDelivery":true}"#) - case ("PUT", "/v1/push/devices/install-1/presence"), - ("DELETE", "/v1/push/devices/install-1"): + case ("DELETE", "/v1/push/devices/install-1"): (204, "") default: (404, "") } @@ -56,15 +55,11 @@ extension APIClientTests { platform: "ios", transport: "apns", token: "aabb", environment: "development", bundleId: "dev.crumble")) #expect(registration.remoteDelivery) - try await client.pushPresence("install-1", active: true, agentId: "a1") - try await client.pushPresence("install-1", active: false, agentId: nil) try await client.unregisterPush("install-1") #expect(StubProtocol.requests.map { "\($0.httpMethod ?? "") \($0.url?.path ?? "")" } == [ "GET /v1/push", "PUT /v1/push/devices/install-1", - "PUT /v1/push/devices/install-1/presence", - "PUT /v1/push/devices/install-1/presence", "DELETE /v1/push/devices/install-1" ]) let registrationRequest = StubProtocol.requests[1] @@ -72,12 +67,6 @@ extension APIClientTests { #expect(try pushDeviceBody(registrationRequest) == .init( bundleId: "dev.crumble", enabled: true, environment: .development, platform: .ios, token: "aabb", transport: .apns)) - let presence = try #require(StubProtocol.requests[2].httpBody) - let active = try JSONDecoder().decode(Operations.PutPushPresence.Input.Body.JsonPayload.self, from: presence) - #expect(active.active) - #expect(active.agentId == "a1") - let inactivePresence = try #require(StubProtocol.requests[3].httpBody) - #expect(try #require(String(data: inactivePresence, encoding: .utf8)).contains(#""agentId":null"#)) } @MainActor @Test func receivedTokenEncodesBytesAsLowercaseHex() async throws { @@ -96,8 +85,6 @@ extension APIClientTests { (200, #"{"serverId":"server-a","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"server-a","remoteDelivery":true}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") default: (404, "") } } @@ -110,7 +97,7 @@ extension APIClientTests { #expect(controller.remoteDelivery) let registrationRequest = try #require(StubProtocol.requests.first { $0.httpMethod == "PUT" }) #expect(try pushDeviceBody(registrationRequest).token == "01fe") - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() } @@ -122,8 +109,6 @@ extension APIClientTests { (200, #"{"serverId":"old-server","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"old-server","remoteDelivery":true}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") default: (404, "") } } @@ -143,8 +128,6 @@ extension APIClientTests { (200, #"{"serverId":"new-server","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"new-server","remoteDelivery":false}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") default: (404, "") } } @@ -165,8 +148,6 @@ extension APIClientTests { (200, #"{"serverId":"server-a","transports":{"apns":true,"fcm":false}}"#) case ("PUT", "/v1/push/devices/\(controller.installationID)"): (200, #"{"serverId":"server-a","remoteDelivery":true}"#) - case ("PUT", "/v1/push/devices/\(controller.installationID)/presence"): - (204, "") default: (404, "") } } @@ -183,7 +164,7 @@ extension APIClientTests { #expect(registrations.count == 2) #expect(try pushDeviceBody(registrations[0]).token == "01") #expect(try pushDeviceBody(registrations[1]).token == "02a0") - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() } @@ -204,7 +185,7 @@ extension APIClientTests { await controller.waitForSync() #expect(!controller.remoteDelivery) #expect(controller.status.contains("Server identity changed")) - controller.setPresence(active: false, agentID: nil) + controller.setForeground(false) await controller.waitForSync() } } diff --git a/macos/CHANGELOG.md b/macos/CHANGELOG.md index a8820b1..bfb00fd 100644 --- a/macos/CHANGELOG.md +++ b/macos/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +- Allow renaming and editing completed one-time automations without rescheduling them. Keep job history updating on slow connections. +- Attachments work with the current server: files upload before their message and a retry uploads only those that failed. A file deleted from the chat's library shows **File deleted** instead of its preview. +- While the main window is active, the app tells the server which chat it shows, so a reply there sends no push to your iPhone or other devices. Replies you've seen on screen count as seen everywhere, and a waiting card counts once it shows its request. Switching to another window or app, leaving the chat, or signing out clears it. +- Automation timing, next runs, and the editor's next-run line come from the server, so they read as on the web, and the list's next runs stay current while it's open. For a new or changed trigger, **Save** is unavailable while the server says it can't run. Unchanged triggers and failed previews don't block saving. Reasoning levels in the composer and the bot form, cited pages under a reply, a job's steps, and what a working bot is doing come from the server too. + - **Settings** no longer configures the server. Providers, the judge and vision models, web search, credentials and logins across bots, password managers, Integrations, Coding, Users, message gateways, and the event relay are set up in Crumble on the web. **Server Settings on the Web** in **General** opens it in the browser, and links that led to those pages, such as **Provider Settings…** under a failed reply, open the matching web page. - A bot can ask to call someone other than you. Its **call request** in the chat shows the callee, number, goal, and opening, with **Decline** and **Approve**. Once placed, the call is a row with its state, and clicking it opens the call beside the chat with the goal and the transcript, live while the call goes on. A call's end notice becomes the same row. - A chat shows a voice gateway call as centered phone lines, as on the web: **Call started**, or, when the bot placed the call, that it called you over the greeting it spoke, and then how the call ended, with any reaction the bot left on it. A message spoken on a call says **Spoken on a call**. diff --git a/macos/Sources/Crumble/AgentEditorView.swift b/macos/Sources/Crumble/AgentEditorView.swift index fafe586..dc75d09 100644 --- a/macos/Sources/Crumble/AgentEditorView.swift +++ b/macos/Sources/Crumble/AgentEditorView.swift @@ -108,12 +108,19 @@ struct AgentEditorView: View { } } ReasoningField( - levels: ThinkingLevel.available(for: draft.model, in: model.models), thinking: $draft.thinking) + preview: model.reasoningBoard.preview( + provider: draft.provider, model: draft.model, level: draft.thinking), + thinking: $draft.thinking) } header: { Text("Model") } footer: { Text(model.modelHint).foregroundStyle(.secondary) } + .task(id: [draft.provider, draft.model, draft.thinking]) { + guard let client = model.client else { return } + await model.reasoningBoard.load( + provider: draft.provider, model: draft.model, level: draft.thinking, client: client) + } } private var instructionsSection: some View { diff --git a/macos/Sources/Crumble/AppModel+Automations.swift b/macos/Sources/Crumble/AppModel+Automations.swift index 2825092..cc441dc 100644 --- a/macos/Sources/Crumble/AppModel+Automations.swift +++ b/macos/Sources/Crumble/AppModel+Automations.swift @@ -32,6 +32,10 @@ extension AppModel { } } + func loadAutomationPreview() async { + if let client { await automationBoard.loadPreview(client: client) } + } + func runAutomation(_ schedule: Schedule) { guard let client else { return } let routeAtStart = workspaceRoute diff --git a/macos/Sources/Crumble/AppModel+Chat.swift b/macos/Sources/Crumble/AppModel+Chat.swift index e0f3e4f..f56b743 100644 --- a/macos/Sources/Crumble/AppModel+Chat.swift +++ b/macos/Sources/Crumble/AppModel+Chat.swift @@ -114,6 +114,7 @@ extension AppModel { /// Keeps older pages the owner already loaded; snapshots only carry the newest page. func applySnapshot(_ incoming: ChatSnapshot) { + snapshotRevision += 1 updateRunningBot(selectedAgentID, running: incoming.isRunning) let incomingMessages = incoming.messages ?? [] let acknowledged = Set(incomingMessages.compactMap(\.requestId)) @@ -121,7 +122,8 @@ extension AppModel { // Rebuild from confirmed transcript rows and append local rows so a delayed snapshot // cannot erase a message the user has already seen. let local = delivery.messages(botID: selectedAgentID) - messages = mergeMessages(messages.filter { $0.deliveryState == .confirmed }, incomingMessages) + messages = deletedFiles.reconcile( + mergeMessages(messages.filter { $0.deliveryState == .confirmed }, incomingMessages), chat: selectedAgentID) messages.append(contentsOf: local) refreshJobsIfChanged() refreshHeldActionsIfChanged() @@ -210,6 +212,7 @@ extension AppModel { let index = agents.firstIndex(where: { $0.id == event.agentId }) { agents[index].lastMessage = lastMessage } + refreshReplyReferences(after: event, active: attentionActive) let context = NotificationContext(windowOnScreen: mainWindowOnScreen(), route: route) guard let client, let note = notification(for: event, in: context) else { return } unread.add(event) @@ -271,7 +274,7 @@ extension AppModel { return { [self] in guard selectionVersion == version else { return } loadingOlder = false - messages = mergeMessages(messages, page.messages ?? []) + messages = deletedFiles.reconcile(mergeMessages(messages, page.messages ?? []), chat: id) refreshHeldActionsIfChanged() refreshBotRequestsIfChanged() refreshCallRequestsIfChanged() @@ -352,29 +355,17 @@ extension AppModel { attachments.removeAll { $0.id == id } } - func attachmentImage(entryID: String, index: Int) -> NSImage? { - attachmentImages["\(entryID)/\(index)"] - } - func attachmentImage(message: Message, index: Int) -> NSImage? { - if let entryID = message.entryId { return attachmentImage(entryID: entryID, index: index) } - let key = selectedGroupID.isEmpty ? selectedAgentID : GroupChat.deliveryKey(selectedGroupID) + if message.entryId != nil { return attachmentKey(message, index: index).flatMap { attachmentImages[$0] } } guard let requestID = message.requestId, - let data = delivery.imageData(botID: key, requestID: requestID, index: index) + let data = delivery.imageData(botID: conversationKey, requestID: requestID, index: index) else { return nil } return NSImage(data: data) } func loadAttachmentImage(entryID: String, index: Int) async { - let key = "\(entryID)/\(index)" - guard attachmentImages[key] == nil, let client else { return } - guard !entryID.hasPrefix("local:") else { return } - let agent = selectedAgentID - let group = selectedGroupID - let data = group.isEmpty - ? try? await client.attachment(agent, entryID: entryID, index: index) - : try? await client.groupAttachment(group, entryID: entryID, index: index) - guard let data, + guard let (key, data) = await downloadAttachment( + entryID: entryID, index: index, cached: { attachmentImages[$0] != nil }), let image = NSImage(data: data) else { return } attachmentImages[key] = image diff --git a/macos/Sources/Crumble/AppModel+Messages.swift b/macos/Sources/Crumble/AppModel+Messages.swift index 8f78f9c..faecd03 100644 --- a/macos/Sources/Crumble/AppModel+Messages.swift +++ b/macos/Sources/Crumble/AppModel+Messages.swift @@ -21,9 +21,12 @@ extension AppModel { let version = selectionVersion return Task { do { + guard let fileIDs = try await uploadFiles( + record, chat: id, requestID: requestID, generation: generation, + upload: { try await client.uploadFile(id, $0) }) + else { return } try await client.sendChatMessage( - id, content: content, requestID: requestID, replyTo: reply, - attachments: files.map(\.outgoing)) + id, content: content, requestID: requestID, replyTo: reply, files: fileIDs) guard self.generation == generation else { return } delivery.accepted(botID: id, requestID: requestID) guard self.generation == generation, self.selectionVersion == version, selectedAgentID == id else { @@ -48,7 +51,8 @@ extension AppModel { } } - /// Re-sends a failed optimistic row with its original idempotency key and attachments. + /// Re-sends a failed optimistic row with its original idempotency key and attachments, uploading only the + /// files an earlier attempt did not. func retryMessage(_ message: Message) { guard selectedGroupID.isEmpty else { return retryGroupMessage(message) } guard message.deliveryState == .failed, let requestID = message.requestId, let client, @@ -67,9 +71,12 @@ extension AppModel { let version = selectionVersion Task { do { + guard let fileIDs = try await uploadFiles( + record, chat: id, requestID: requestID, generation: generation, + upload: { try await client.uploadFile(id, $0) }) + else { return } try await client.sendChatMessage( - id, content: record.content, requestID: requestID, - replyTo: record.replyTo, attachments: record.attachments.map(\.outgoing)) + id, content: record.content, requestID: requestID, replyTo: record.replyTo, files: fileIDs) guard self.generation == generation else { return } delivery.accepted(botID: id, requestID: requestID) guard self.generation == generation, self.selectionVersion == version, selectedAgentID == id else { @@ -103,7 +110,7 @@ extension AppModel { private func failMessage(_ error: Error, id: String, requestID: String, version: Int) -> Bool { if self.selectionVersion == version, selectedAgentID == id { sending = false } - guard delivery.fail(botID: id, requestID: requestID) else { return false } + guard delivery.fail(botID: id, requestID: requestID, error: error) else { return false } if self.selectionVersion == version, selectedAgentID == id { errorText = "Message was not confirmed: " + friendlyError(error) if let visible = messages.firstIndex(where: { $0.requestId == requestID }) { diff --git a/macos/Sources/Crumble/AppModel.swift b/macos/Sources/Crumble/AppModel.swift index c419f4a..d96ff4b 100644 --- a/macos/Sources/Crumble/AppModel.swift +++ b/macos/Sources/Crumble/AppModel.swift @@ -14,7 +14,9 @@ final class AppModel { private(set) var generation = 0 var agents: [Agent] = [] - var route: Route? + var route: Route? { + didSet { if route != oldValue { updateChatAttention() } } + } var workspaceRoute: Route? /// The page the Settings window should show next. var settingsTarget: SettingsTarget? @@ -80,7 +82,8 @@ final class AppModel { var failedReplyTo = "" var failedAttachments: [UUID] = [] var delivery = BotChatDelivery() - /// Sent images, keyed by entry and attachment index; they never change once sent. + var deletedFiles = DeletedFiles() + /// Sent images, keyed by chat and file ID; a new connection clears them. var attachmentImages: [String: NSImage] = [:] private var activeRequests = 0 @@ -98,6 +101,13 @@ final class AppModel { @ObservationIgnored private var started = false @ObservationIgnored private let connectionMonitor = ConnectionMonitor() @ObservationIgnored var notifier = Notifier.shared + /// Which chat the main window shows, for the server's push suppression, and which replies the owner saw. + let chatAttention = ChatAttention() + /// The main window is the active window of the active app. + @ObservationIgnored var attentionActive = false { + didSet { if attentionActive != oldValue { updateChatAttention() } } + } + @ObservationIgnored var snapshotRevision = 0 var agentMemories: [String: [Memory]] = [:] var memoryLoadVersion = 0 @@ -276,7 +286,7 @@ extension AppModel { func signOut() { guard let client, !accountBoard.isSigningOut else { return } Task { - let outcome = await accountBoard.signOut(client: client) + let outcome = await accountBoard.signOut(client: client) { await self.chatAttention.disconnect(client) } Keychain.delete("server-token") token = "" applyConnection(APIClient(baseURL: client.baseURL, token: "")) @@ -292,6 +302,8 @@ extension AppModel { pendingMutations.removeAll() mutationRevision += 1 resetPendingMessages() + deletedFiles.removeAll() + attachmentImages = [:] agents = [] agentMemories = [:] sharedMemories = [] @@ -329,6 +341,7 @@ extension AppModel { groupDraft = nil messages = [] client = candidate + updateChatAttention() activeRequests = 0 loading = false errorText = "" diff --git a/macos/Sources/Crumble/AutomationsPanel.swift b/macos/Sources/Crumble/AutomationsPanel.swift index 720e834..985b841 100644 --- a/macos/Sources/Crumble/AutomationsPanel.swift +++ b/macos/Sources/Crumble/AutomationsPanel.swift @@ -7,8 +7,7 @@ struct AutomationsPanel: View { var body: some View { AutomationsPage( - board: model.automationBoard, agents: model.agents, - sources: model.connectedServices.eventSources.sources, client: model.client, + board: model.automationBoard, agents: model.agents, client: model.client, onCreate: model.openNewAutomation, onRun: model.runAutomation, onOpenBot: { model.selectAgent($0) }) } } diff --git a/macos/Sources/Crumble/ChatAttachments.swift b/macos/Sources/Crumble/ChatAttachments.swift index 729f4d8..47a8ee4 100644 --- a/macos/Sources/Crumble/ChatAttachments.swift +++ b/macos/Sources/Crumble/ChatAttachments.swift @@ -31,7 +31,8 @@ struct PendingAttachmentChip: View { } } -/// The files a sent message carries: image thumbnails loaded from the server, text files by name. +/// The files a sent message carries: image thumbnails loaded from the server, other files by name, and a +/// placeholder for a file deleted from the chat's library. struct SentAttachments: View { @Environment(AppModel.self) private var model let message: Message @@ -60,7 +61,7 @@ struct SentAttachments: View { } } } else { - FileLabel(name: file.name) + FileLabel(name: file.deleted ? "File deleted" : file.name) } } } diff --git a/macos/Sources/Crumble/ChatMessages.swift b/macos/Sources/Crumble/ChatMessages.swift index fb8ca6d..8fcf110 100644 --- a/macos/Sources/Crumble/ChatMessages.swift +++ b/macos/Sources/Crumble/ChatMessages.swift @@ -29,7 +29,7 @@ struct MessageView: View { } } else if message.kind == HeldActionEvent.messageKind, let held = message.heldAction { HStack { - HeldActionCard(held: held, title: message.text) + HeldActionCard(held: held, title: message.text).replyCard(message) Spacer(minLength: 56) } } else if let failure = JobFailure(message: message) { @@ -81,17 +81,17 @@ struct MessageView: View { } } else if let request = BotRequest(message: message) { HStack { - BotRequestCard(request: request) + BotRequestCard(request: request).replyCard(message) Spacer(minLength: 56) } } else if let request = CallRequest(message: message) { HStack { - CallRequestCard(request: request) + CallRequestCard(request: request).replyCard(message) Spacer(minLength: 56) } } else if let ask = BotSecretAsk(message: message) { HStack { - BotSecretRequestCard(ask: ask) + BotSecretRequestCard(ask: ask).replyCard(message) Spacer(minLength: 56) } } @@ -101,14 +101,14 @@ struct MessageView: View { } private var receivedMessage: some View { - let reply = SourceCitations.split(message.text, sources: message.sources ?? []) - return HStack(alignment: .center, spacing: 6) { + HStack(alignment: .center, spacing: 6) { VStack(alignment: .leading, spacing: 6) { - MarkdownText(text: reply.text) + MarkdownText(text: message.presentedText) .font(Palette.messageFont) .lineSpacing(Palette.messageLineSpacing) .textSelection(.enabled) - ForEach(reply.chips, id: \.href) { SourceChipLink(chip: $0) } + .replySurface(message, .text, ready: message.showsReplyText) + ForEach(message.citations, id: \.href) { CitationLink(citation: $0) } } .bubble(owner: false) .fixedSize(horizontal: false, vertical: true) diff --git a/macos/Sources/Crumble/ChatView.swift b/macos/Sources/Crumble/ChatView.swift index ad83675..2883d81 100644 --- a/macos/Sources/Crumble/ChatView.swift +++ b/macos/Sources/Crumble/ChatView.swift @@ -24,15 +24,13 @@ enum ChatRow: Identifiable { var rows: [ChatRow] = hasMore ? [.older] : [] var last: Int64 = 0 let reactions = Reaction.byMessage(messages) - let sources = SourceCitations.byReply(messages) - for var message in messages where shownInChat(message) { + for message in messages where shownInChat(message) { if let timestamp = message.timestamp, timestamp > 0 { if timestamp - last > 30 * 60 * 1000 { rows.append(.time(message.id, timeLabel(Date(timeIntervalSince1970: Double(timestamp) / 1000)))) } last = timestamp } - message.sources = sources[message.id] rows.append(.message(message, reactions: reactions[message.id] ?? [])) } if let snapshot { @@ -84,6 +82,7 @@ struct ChatView: View { .defaultScrollAnchor(.bottom, for: .sizeChanges) .jumpToLatest() .scrollEdgeEffectStyle(.soft, for: .all) + .chatAttention(.bot(agent.id), ready: model.snapshot != nil) .overlay { if rows.isEmpty { EmptyChatView(agent: agent) } } @@ -208,7 +207,7 @@ struct ChatRowView: View { case .message(let message, let reactions): MessageView(message: message, reactions: reactions, botName: agent.name) case .thinking: - let label = Working(snapshot: model.snapshot, messages: model.messages).label + "…" + let label = (model.snapshot?.working ?? .thinking).label + "…" HStack(spacing: 10) { TypingDots() .padding(.horizontal, 15) diff --git a/macos/Sources/Crumble/CrumbleApp.swift b/macos/Sources/Crumble/CrumbleApp.swift index a76b7f5..dfeb2df 100644 --- a/macos/Sources/Crumble/CrumbleApp.swift +++ b/macos/Sources/Crumble/CrumbleApp.swift @@ -54,6 +54,8 @@ struct CrumbleApp: App { struct ContentView: View { @Environment(AppModel.self) private var model @Environment(\.openWindow) private var openWindow + /// The main window is key or main in the active app; another window, a minimized one, or another app isn't. + @Environment(\.appearsActive) private var appearsActive var body: some View { @Bindable var model = model @@ -73,6 +75,8 @@ struct ContentView: View { model.notifier.openMainWindow = { openWindow(id: "main") } } .onChange(of: model.route) { model.markChatSeen() } + .onChange(of: appearsActive, initial: true) { _, active in model.attentionActive = active } + .onDisappear { model.attentionActive = false } .onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in model.markChatSeen() } diff --git a/macos/Sources/Crumble/DetailsPanel.swift b/macos/Sources/Crumble/DetailsPanel.swift index df7925b..85bc0c5 100644 --- a/macos/Sources/Crumble/DetailsPanel.swift +++ b/macos/Sources/Crumble/DetailsPanel.swift @@ -72,7 +72,7 @@ struct DetailsPanel: View { return HStack(alignment: .top, spacing: 12) { VStack(alignment: .leading, spacing: 1) { Text(schedule.name).font(.subheadline.weight(.medium)).lineLimit(1) - Text(automationTiming(schedule, sources: model.connectedServices.eventSources.sources)) + Text(schedule.timing) .font(.caption) .foregroundStyle(.secondary) if let error = board.errors[schedule.id] { diff --git a/macos/Sources/Crumble/GroupChatViews.swift b/macos/Sources/Crumble/GroupChatViews.swift index 8eed8e8..5b5a260 100644 --- a/macos/Sources/Crumble/GroupChatViews.swift +++ b/macos/Sources/Crumble/GroupChatViews.swift @@ -80,6 +80,7 @@ struct GroupChatView: View { .defaultScrollAnchor(.bottom, for: .sizeChanges) .jumpToLatest() .scrollEdgeEffectStyle(.soft, for: .all) + .chatAttention(.group(group.id), ready: model.groupSnapshot != nil) .overlay { if rows.isEmpty { if model.groupSnapshot == nil { @@ -244,13 +245,13 @@ struct GroupBotMessage: View { } private var bubble: some View { - let reply = SourceCitations.split(message.text, sources: message.sources ?? []) - return VStack(alignment: .leading, spacing: 6) { - MarkdownText(text: reply.text) + VStack(alignment: .leading, spacing: 6) { + MarkdownText(text: message.presentedText) .font(Palette.messageFont) .lineSpacing(Palette.messageLineSpacing) .textSelection(.enabled) - ForEach(reply.chips, id: \.href) { SourceChipLink(chip: $0) } + .replySurface(message, .text, ready: message.showsReplyText) + ForEach(message.citations, id: \.href) { CitationLink(citation: $0) } } .bubble(owner: false) .fixedSize(horizontal: false, vertical: true) @@ -291,18 +292,18 @@ struct GroupBotMessage: View { } } -/// A page the reply's turn read, opened in the browser. -struct SourceChipLink: View { - let chip: SourceChip +/// A page the reply cited, opened in the browser. +struct CitationLink: View { + let citation: Citation var body: some View { - if let url = URL(string: chip.href) { + if let url = URL(string: citation.href) { Link(destination: url) { - Label(chip.title.nilIfEmpty ?? chip.href, systemImage: "link") + Label(citation.title.nilIfEmpty ?? citation.site, systemImage: "link") .font(.callout) .lineLimit(1) } - .help(chip.href) + .help(citation.href) } } } diff --git a/macos/Sources/Crumble/JobViews.swift b/macos/Sources/Crumble/JobViews.swift index 35d85fd..7794790 100644 --- a/macos/Sources/Crumble/JobViews.swift +++ b/macos/Sources/Crumble/JobViews.swift @@ -184,7 +184,7 @@ struct JobSheet: View { let job: JobHistory var inPanel = false - private var items: [CodingJobItem] { CodingJobItem.items(from: job.messages) } + private var items: [JobHistoryItem] { job.items } private var current: Job? { model.jobs[Job.id(job.kind, job.name)] } private var working: Bool { current?.isWorking ?? false } private var exporting: Binding { @@ -316,7 +316,7 @@ struct JobSheet: View { .textSelection(.enabled) } ForEach(items) { item in - CodingJobItemView(item: item) + JobItemView(item: item) } if working && job.loaded { HStack(spacing: 6) { @@ -346,15 +346,15 @@ struct JobSheet: View { } } -private struct CodingJobItemView: View { - let item: CodingJobItem +private struct JobItemView: View { + let item: JobHistoryItem var body: some View { switch item { - case .task(_, let text): + case .task(let task): VStack(alignment: .leading, spacing: 4) { Text("Task").font(.system(size: 12)).foregroundStyle(.secondary) - Text(text) + Text(task.text) .font(Palette.messageFont) .textSelection(.enabled) .padding(.horizontal, 14) @@ -362,60 +362,50 @@ private struct CodingJobItemView: View { .background(Color.accentColor.opacity(0.12), in: .rect(cornerRadius: 14)) } .accessibilityElement(children: .combine) - case .reply(_, let text): - MarkdownText(text: text) + case .reply(let reply): + MarkdownText(text: reply.text) .font(Palette.messageFont) .lineSpacing(Palette.messageLineSpacing) .textSelection(.enabled) .frame(maxWidth: .infinity, alignment: .leading) - case .tool(let tool): - CodingToolStep(tool: tool) + case .step(let step): + JobStepView(step: step) } } } -/// One tool call: what ran (a command or a file). Click it to see the whole output. -private struct CodingToolStep: View { - let tool: CodingJobItem.Tool +/// One tool call: what ran (a command or a file), as the server labels it. Click it to see the whole output. +private struct JobStepView: View { + let step: JobStepItem @State private var open = false private var icon: String { - switch tool.name { - case "bash": "terminal" - case "read": "doc.text" - case "write": "square.and.pencil" - case "edit": "pencil" - case "computer_use": JobKind.desktop.icon - default: "wrench.and.screwdriver" + switch step.icon { + case .terminal: "terminal" + case .file: "doc.text" + case .pencil: "pencil" + case .pointer: JobKind.desktop.icon + case .tool: "wrench.and.screwdriver" } } - private var verb: String { - switch tool.name { - case "bash": "Ran" - case "read": "Read" - case "write": "Wrote" - case "edit": "Edited" - case "computer_use": "Used the bot desktop" - default: tool.name.capitalized - } - } + private var subject: String { step.subject ?? "" } private var summary: some View { Button { open.toggle() } label: { HStack(alignment: .firstTextBaseline, spacing: 8) { - Image(systemName: tool.isError ? "exclamationmark.triangle.fill" : icon) - .foregroundStyle(tool.isError ? .red : .secondary) + Image(systemName: step.isError ? "exclamationmark.triangle.fill" : icon) + .foregroundStyle(step.isError ? .red : .secondary) .frame(width: 16) - Text(verb).foregroundStyle(.secondary) - Text(tool.subject) + Text(step.label).foregroundStyle(.secondary) + Text(subject) .font(.system(size: 12.5, design: .monospaced)) .lineLimit(open ? nil : 4) - if !tool.finished { ProgressView().controlSize(.mini) } + if !step.finished { ProgressView().controlSize(.mini) } Spacer(minLength: 0) - if tool.finished { + if step.finished { Image(systemName: open ? "chevron.down" : "chevron.right") .font(.caption2.weight(.medium)) .foregroundStyle(.tertiary) @@ -425,8 +415,8 @@ private struct CodingToolStep: View { .contentShape(Rectangle()) } .buttonStyle(.plain) - .disabled(!tool.finished) - .accessibilityLabel("\(verb) \(tool.subject)\(tool.isError ? ", failed" : "")") + .disabled(!step.finished) + .accessibilityLabel("\(step.label) \(subject)\(step.isError ? ", failed" : "")") .accessibilityValue(open ? "Expanded" : "Collapsed") } @@ -434,9 +424,9 @@ private struct CodingToolStep: View { VStack(alignment: .leading, spacing: 6) { summary if open { - Text(tool.shownOutput) + Text(step.shownOutput) .font(.system(size: 12, design: .monospaced)) - .foregroundStyle(tool.isError ? Color.red : Color.primary) + .foregroundStyle(step.isError ? Color.red : Color.primary) .textSelection(.enabled) .padding(10) .frame(maxWidth: .infinity, alignment: .leading) diff --git a/macos/Sources/Crumble/PanelForms.swift b/macos/Sources/Crumble/PanelForms.swift index 462d54a..3effb58 100644 --- a/macos/Sources/Crumble/PanelForms.swift +++ b/macos/Sources/Crumble/PanelForms.swift @@ -73,13 +73,15 @@ struct AutomationFormView: View { draft: $draft, agents: model.agents, capabilities: model.capabilities, sources: model.connectedServices.eventSources.sources, sourcesLoaded: model.connectedServices.eventSources.isLoaded, - eventRelayURL: model.client?.webSettingsURL(.eventRelay)) + eventRelayURL: model.client?.webSettingsURL(.eventRelay), + preview: model.automationBoard.draftPreview, loadPreview: model.loadAutomationPreview) } .formStyle(.grouped) .frame(width: 480, height: 560) .toolbar { SheetActions( - onCancel: model.automationBoard.closeDraft, onSave: model.saveAutomation, saveDisabled: false) + onCancel: model.automationBoard.closeDraft, onSave: model.saveAutomation, + saveDisabled: model.automationBoard.draftPreviewProblem != nil) } } } diff --git a/macos/Sources/Crumble/ReplyAttention.swift b/macos/Sources/Crumble/ReplyAttention.swift new file mode 100644 index 0000000..35f224b --- /dev/null +++ b/macos/Sources/Crumble/ReplyAttention.swift @@ -0,0 +1,114 @@ +import apfelkern +import SwiftUI + +extension AppModel { + /// Reports the chat the main window shows while the window is active and the account signed in. + func updateChatAttention() { + chatAttention.update( + client: isSignedIn ? client : nil, active: attentionActive, route: route?.attentionChat) + } +} + +extension EnvironmentValues { + /// The chat whose transcript a view sits in, for its reply surfaces. + @Entry var attentionChat: ChatAttentionChat? +} + +extension View { + /// Mounts the chat while its transcript shows, and reports what covers its scroll view's edges. + /// Apply to the chat's scroll view. + func chatAttention(_ chat: ChatAttentionChat, ready: Bool) -> some View { + modifier(ChatAttentionMount(chat: chat, ready: ready)) + } + + /// Acknowledges the message's replies on this exact surface once it's ready and on screen. + func replySurface(_ message: Message, _ surface: ReplySurface, ready: Bool) -> some View { + modifier(ReplySurfaceReport( + key: "\(message.id) \(surface)", eventIDs: message.attentionEventIDs(for: surface), ready: ready)) + } + + /// Acknowledges a waiting card once its board has the server's state for it and it's on screen. + func replyCard(_ message: Message) -> some View { + modifier(ReplyCardReport(message: message)) + } +} + +private struct ChatAttentionMount: ViewModifier { + @Environment(AppModel.self) private var model + let chat: ChatAttentionChat + let ready: Bool + + func body(content: Content) -> some View { + content + .environment(\.attentionChat, chat) + .onScrollGeometryChange(for: EdgeInsets.self) { $0.contentInsets } action: { _, insets in + model.chatAttention.setViewportInsets(top: insets.top, bottom: insets.bottom) + } + // A window keeps its chat view when the owner picks another chat, so the chat itself can change. + .onChange(of: ready ? chat : nil, initial: true) { old, new in + if let old, old != new { model.chatAttention.unmount(old) } + if let new { model.chatAttention.mount(new) } + } + .onAppear { if ready { model.chatAttention.mount(chat) } } + .onDisappear { model.chatAttention.unmount(chat) } + } +} + +private struct ReplyCardReport: ViewModifier { + @Environment(AppModel.self) private var model + let message: Message + + func body(content: Content) -> some View { + let card = message.replyCard( + heldActions: model.heldActionBoard, botRequests: model.botRequestBoard, + callRequests: model.callRequestBoard, botSecrets: model.botSecretBoard) + content.modifier(ReplySurfaceReport( + key: "\(message.id) card", eventIDs: card.map { message.attentionEventIDs(for: $0.surface) } ?? [], + ready: card?.ready ?? false)) + } +} + +/// Reports a surface's frame in its scroll view while it has replies to acknowledge. The policy of what counts +/// as seen lives in `ChatAttention`. +private struct ReplySurfaceReport: ViewModifier { + struct Placement: Equatable { + var frame: CGRect + var container: CGSize + } + + private struct Report: Equatable { + var chat: ChatAttentionChat? + var placement: Placement? + var eventIDs: [String] + var ready: Bool + } + + @Environment(AppModel.self) private var model + @Environment(\.attentionChat) private var chat + let key: String + let eventIDs: [String] + let ready: Bool + @State private var placement: Placement? + + func body(content: Content) -> some View { + content + .onGeometryChange(for: Placement?.self) { [eventIDs] proxy in + guard !eventIDs.isEmpty, let scroll = proxy.bounds(of: .scrollView) else { return nil } + return Placement(frame: proxy.frame(in: .scrollView), container: scroll.size) + } action: { placement = $0 } + .onChange( + of: Report(chat: chat, placement: placement, eventIDs: eventIDs, ready: ready), initial: true + ) { _, report in + guard let chat = report.chat else { return } + guard let placement = report.placement, !report.eventIDs.isEmpty else { + return model.chatAttention.removeSurface(key, of: chat) + } + model.chatAttention.setSurface( + key, of: chat, frame: placement.frame, container: placement.container, + eventIDs: report.eventIDs, ready: report.ready) + } + .onDisappear { + if let chat { model.chatAttention.removeSurface(key, of: chat) } + } + } +} diff --git a/macos/Tests/CrumbleTests/CallRequestTests.swift b/macos/Tests/CrumbleTests/CallRequestTests.swift index 031052d..d841944 100644 --- a/macos/Tests/CrumbleTests/CallRequestTests.swift +++ b/macos/Tests/CrumbleTests/CallRequestTests.swift @@ -38,8 +38,9 @@ extension APIClientTests { return (model, request) } - private static let page = #"{"messages":[{"id":"t1","entryId":"e:1","role":"user","content":"Hello?"},"# - + #"{"id":"t2","entryId":"e:2","role":"assistant","content":"Hi, this is Bot.","# + private static let page = #"{"messages":[{"id":"t1","entryId":"e:1","# + + #""replyReferences":[],"role":"user","content":"Hello?"},"# + + #"{"id":"t2","entryId":"e:2","replyReferences":[],"role":"assistant","content":"Hi, this is Bot.","# + #""blocks":[{"type":"text","text":"Hi, this is Bot."}]}],"hasMore":false,"oldestEntryId":null}"# @MainActor @Test func openingACallLoadsItsTranscript() async throws { diff --git a/macos/Tests/CrumbleTests/ChatAttentionTests.swift b/macos/Tests/CrumbleTests/ChatAttentionTests.swift new file mode 100644 index 0000000..e893270 --- /dev/null +++ b/macos/Tests/CrumbleTests/ChatAttentionTests.swift @@ -0,0 +1,88 @@ +import apfelkern +import Foundation +import Testing + +@testable import Crumble + +private func attentionChat(_ request: URLRequest) -> JSONValue? { + guard let body = request.httpBody, + case .object(let fields) = try? JSONDecoder().decode(JSONValue.self, from: body) + else { return nil } + return fields["chat"] +} + +private func reportedChat(_ kind: String, _ id: String) -> JSONValue { + .object(["kind": .string(kind), "id": .string(id)]) +} + +private let referencedReply = #"{"agentId":"a1","status":"idle","working":"idle","partial":"","updatedAt":0,"# + + #""error":null,"hasMore":false,"oldestEntryId":null,"conversationId":"c1","# + + #""conversation":{"id":"c1","agentId":"a1","title":"Chat","createdAt":"now","updatedAt":"now"},"# + + #""messages":[{"id":"a1:2:0","entryId":"a1:2","role":"assistant","content":"Done","# + + #""replyReferences":[{"eventId":"reply-event","surface":{"kind":"text"}}]}]}"# + +@MainActor +private func eventually(_ done: () -> Bool) async -> Bool { + for _ in 0..<300 where !done() { try? await Task.sleep(for: .milliseconds(10)) } + return done() +} + +extension APIClientTests { + @MainActor @Test func theMainWindowReportsItsChatWithoutPushAndClearsBeforeSignOut() async throws { + let client = StubProtocol.client(token: "session") { _ in (204, "") } + let model = AppModel(client: client) + let presence = { + StubProtocol.requests.filter { $0.url?.path.hasPrefix("/v1/chat-attention/views/") == true } + } + model.route = .agent("a1") + model.attentionActive = true + try await Task.sleep(for: .milliseconds(50)) + #expect(presence().isEmpty) + + // The chat's view mounts once its transcript shows. + model.chatAttention.mount(.bot("a1")) + #expect(await eventually { presence().count == 1 }) + #expect(attentionChat(presence()[0]) == reportedChat("bot", "a1")) + + model.attentionActive = false + #expect(await eventually { presence().count == 2 }) + #expect(attentionChat(presence()[1]) == .null) + + model.attentionActive = true + model.route = .group("g1") + model.chatAttention.mount(.group("g1")) + #expect(await eventually { presence().last.flatMap(attentionChat) == reportedChat("group", "g1") }) + #expect(!StubProtocol.requests.contains { $0.url?.path.hasPrefix("/v1/push") == true }) + + model.signOut() + #expect(await eventually { model.client?.token.isEmpty == true }) + let last = try #require(presence().last) + #expect(attentionChat(last) == .null) + #expect(last.value(forHTTPHeaderField: "Authorization") == "Bearer session") + } + + @MainActor @Test func aLiveReplyReloadsTheOpenChatAndKeepsTheDraft() async throws { + let client = StubProtocol.client(token: "session") { request in + request.url?.path == "/v1/agents/a1/chat" ? (200, referencedReply) : (204, "") + } + let model = AppModel(client: client) + let reads = { StubProtocol.requests.filter { $0.url?.path == "/v1/agents/a1/chat" }.count } + model.selectedAgentID = "a1" + model.route = .agent("a1") + model.messages = [Message(id: "a1:1:0", entryId: "a1:1", role: "user", content: .string("Hi"))] + model.draft = "Keep this" + let reply = ActivityEvent(eventId: "reply-event", type: "reply", agentId: "a1", agentName: "Atlas") + + model.handleActivity(reply) + try await Task.sleep(for: .milliseconds(50)) + #expect(reads() == 0) + + model.attentionActive = true + model.handleActivity(reply) + #expect(await eventually { model.messages.count == 2 }) + #expect(reads() == 1) + #expect(model.messages.last?.attentionEventIDs(for: .text) == ["reply-event"]) + #expect(model.messages.first?.text == "Hi") + #expect(model.draft == "Keep this") + } +} diff --git a/macos/Tests/CrumbleTests/ContractFixtures.swift b/macos/Tests/CrumbleTests/ContractFixtures.swift index 374f0bf..23bc171 100644 --- a/macos/Tests/CrumbleTests/ContractFixtures.swift +++ b/macos/Tests/CrumbleTests/ContractFixtures.swift @@ -42,7 +42,8 @@ func memoryFixture(_ source: String) -> String { func chatFixture(_ agentID: String = "a1", status: String = "idle") -> String { JSONValue.object([ - "agentId": .string(agentID), "status": .string(status), "messages": .array([]), + "agentId": .string(agentID), "status": .string(status), + "working": .string(status == "running" ? "thinking" : "idle"), "messages": .array([]), "hasMore": .bool(false), "oldestEntryId": .null, "conversationId": .string("c1"), "conversation": .object([ "id": .string("c1"), "agentId": .string(agentID), "title": .string("Chat"), diff --git a/macos/Tests/CrumbleTests/ControlledDeliveryProtocol.swift b/macos/Tests/CrumbleTests/ControlledDeliveryProtocol.swift index ac0e343..59c6c39 100644 --- a/macos/Tests/CrumbleTests/ControlledDeliveryProtocol.swift +++ b/macos/Tests/CrumbleTests/ControlledDeliveryProtocol.swift @@ -117,10 +117,13 @@ extension ControlledDeliveryController { return false } - func release(_ path: String, body: String) { + func release(_ path: String, body: String, status: Int = 200) { + release(path, data: Data(body.utf8), status: status) + } + + func release(_ path: String, data: Data, status: Int = 200) { heldPaths.remove(path) - heldRequests.removeValue(forKey: path)?.resume( - returning: ControlledHTTPResponse(status: 200, body: Data(body.utf8))) + heldRequests.removeValue(forKey: path)?.resume(returning: ControlledHTTPResponse(status: status, body: data)) } } diff --git a/macos/Tests/CrumbleTests/CrumbleTests.swift b/macos/Tests/CrumbleTests/CrumbleTests.swift index dadd095..99a9661 100644 --- a/macos/Tests/CrumbleTests/CrumbleTests.swift +++ b/macos/Tests/CrumbleTests/CrumbleTests.swift @@ -10,6 +10,8 @@ import Testing final class StubProtocol: URLProtocol, @unchecked Sendable { nonisolated(unsafe) static var handler: ((URLRequest) -> (Int, String))? nonisolated(unsafe) static var requests: [URLRequest] = [] + /// Binary bodies by path, such as file downloads, served with status 200 ahead of the handler. + nonisolated(unsafe) static var files: [String: Data] = [:] nonisolated(unsafe) private static var sessionID = "" override static func canInit(with request: URLRequest) -> Bool { true } @@ -33,7 +35,9 @@ final class StubProtocol: URLProtocol, @unchecked Sendable { // current session's handler and request log instead of reusing its canned responses. let current = recorded.value(forHTTPHeaderField: "X-Crumble-Test-Session") == Self.sessionID if current { Self.requests.append(recorded) } - let (status, body) = current ? Self.handler?(recorded) ?? (404, "") : (401, "") + let file = current ? request.url.flatMap { Self.files[$0.path] } : nil + let (status, body) = file.map { _ in (200, "") } + ?? (current ? Self.handler?(recorded) ?? (404, "") : (401, "")) guard let url = request.url, let response = HTTPURLResponse( url: url, statusCode: status, httpVersion: "HTTP/1.1", headerFields: nil) else { @@ -42,7 +46,7 @@ final class StubProtocol: URLProtocol, @unchecked Sendable { return } client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed) - client?.urlProtocol(self, didLoad: Data(body.utf8)) + client?.urlProtocol(self, didLoad: file ?? Data(body.utf8)) client?.urlProtocolDidFinishLoading(self) } @@ -51,6 +55,7 @@ final class StubProtocol: URLProtocol, @unchecked Sendable { static func client(token: String = "", _ handler: @escaping (URLRequest) -> (Int, String)) -> APIClient { self.handler = handler requests = [] + files = [:] let configuration = URLSessionConfiguration.ephemeral sessionID = UUID().uuidString configuration.httpAdditionalHeaders = ["X-Crumble-Test-Session": sessionID] @@ -113,6 +118,7 @@ struct APIClientTests { { "id": "a1:8:0", "entryId": "a1:8", + "replyReferences": [], "role": "user", "content": "older" } @@ -134,21 +140,17 @@ struct APIClientTests { #expect(body["replyTo"]?.stringValue == "a1:41") } - @Test func messagesCarryAttachments() async throws { + @Test func messagesCarryFileIDs() async throws { let client = StubProtocol.client { _ in (202, executionFixture()) } - try await client.sendChatMessage( - "a1", content: "", requestID: "req", replyTo: "", - attachments: [OutgoingAttachment(name: "dot.png", mimeType: "image/png", data: "AAAA")]) + try await client.sendChatMessage("a1", content: "", requestID: "req", replyTo: "", files: ["f1"]) let body = try JSONSerialization.jsonObject(with: StubProtocol.requests.last?.httpBody ?? Data()) as? [String: Any] #expect(body?["replyTo"] == nil) - #expect((body?["attachments"] as? [[String: String]])?.first?["mimeType"] == "image/png") - let data = Data( - #""" - {"id":"a1:5:0","role":"user","content":"", - "attachments":[{"name":"dot.png","mimeType":"image/png","size":70,"kind":"image"}]} - """#.utf8) - let message = try JSONDecoder().decode(Message.self, from: data) + #expect(body?["attachments"] == nil) + #expect(body?["files"] as? [String] == ["f1"]) + let message = Message( + id: "a1:5:0", role: "user", content: .string(""), + attachments: [AttachmentInfo(id: "f1", name: "dot.png", mimeType: "image/png", size: 70)]) #expect(message.attachments?.first?.isImage == true) #expect(shownInChat(message)) } diff --git a/macos/Tests/CrumbleTests/FileCompatibilityTests.swift b/macos/Tests/CrumbleTests/FileCompatibilityTests.swift new file mode 100644 index 0000000..f279463 --- /dev/null +++ b/macos/Tests/CrumbleTests/FileCompatibilityTests.swift @@ -0,0 +1,254 @@ +import apfelkern +import AppKit +import Foundation +import Testing + +@testable import Crumble + +private func uploadFixture(_ id: String) -> String { + #"{"file":{"id":"\#(id)","name":"file","mimeType":"text/plain","size":2,"createdAt":"now"},"existed":false}"# +} + +private func pngData() -> Data { + let image = NSImage(size: NSSize(width: 1, height: 1), flipped: false) { rect in + NSColor.red.setFill() + rect.fill() + return true + } + guard let tiff = image.tiffRepresentation, let bitmap = NSBitmapImageRep(data: tiff), + let png = bitmap.representation(using: .png, properties: [:]) + else { preconditionFailure("Expected PNG data") } + return png +} + +private func imageMessage(_ entry: String, file: AttachmentInfo) -> Message { + Message(id: "a1:\(entry):0", entryId: "a1:\(entry)", role: "user", attachments: [file]) +} + +private let dot = AttachmentInfo(id: "f1", name: "dot.png", mimeType: "image/png", size: 70) + +private let tripFixture = """ + {"groupChat":{"id":"trip","name":"Trip","memberIds":["a1","a2"],"createdAt":"now","updatedAt":"now"}, + "activity":{"paused":false,"botTurns":0,"members":[]}, + "messages":[{"id":"trip:1:0","entryId":"trip:1","replyReferences":[],"role":"user","content":"Map", + "files":[{"id":"g1","name":"map.png","mimeType":"image/png","size":70}]}], + "hasMore":false,"oldestEntryId":"trip:1","updatedAt":1} + """ + +/// Attachments upload before their message and are fetched by file ID, as the current server contract requires. +extension APIClientTests { + @MainActor private func waitFor(_ condition: () -> Bool) async { + for _ in 0..<200 { + if condition() { return } + try? await Task.sleep(for: .milliseconds(10)) + } + } + + private func requests(_ path: String) -> [URLRequest] { + StubProtocol.requests.filter { $0.url?.path == path } + } + + private func bodies(_ path: String) -> [JSONValue] { + requests(path).compactMap { $0.httpBody }.compactMap { try? JSONDecoder().decode(JSONValue.self, from: $0) } + } + + @MainActor private func botChat(handler: @escaping (URLRequest) -> (Int, String)) async -> AppModel { + let model = AppModel(client: StubProtocol.client { request in + request.url?.path == "/v1/agents/a1/chat" ? (200, chatFixture()) : handler(request) + }) + model.selectAgent("a1") + await waitFor { model.snapshot != nil } + return model + } + + @MainActor @Test func botSendsUploadRawBytesThenCarryFileIDs() async { + let model = await botChat { request in + switch request.url?.path { + case "/v1/agents/a1/files": (201, uploadFixture("f1")) + case "/v1/agents/a1/messages": (202, executionFixture()) + default: (404, "") + } + } + defer { model.cancelStream(preservingWork: false) } + model.draft = "Read this" + model.attachments = [PendingAttachment(name: "notes ü.txt", mimeType: "text/plain", data: Data("hi".utf8))] + await model.sendMessage()?.value + + let upload = requests("/v1/agents/a1/files") + #expect(upload.count == 1) + #expect(upload.first?.value(forHTTPHeaderField: "Content-Type") == "text/plain") + #expect(upload.first?.value(forHTTPHeaderField: "X-File-Name") == "notes%20%C3%BC.txt") + #expect(upload.first?.httpBody == Data("hi".utf8)) + let body = bodies("/v1/agents/a1/messages").first + #expect(body?["files"] == .array([.string("f1")])) + #expect(body?["attachments"] == nil) + #expect(model.messages.last?.deliveryState == .sending) + #expect(model.messages.last?.attachments?.first?.name == "notes ü.txt") + } + + @MainActor @Test func aRetryUploadsOnlyTheFilesAFailedAttemptMissed() async { + var failedOnce = false + let model = await botChat { request in + switch request.url?.path { + case "/v1/agents/a1/files": + let name = request.value(forHTTPHeaderField: "X-File-Name") ?? "" + if name == "b.txt", !failedOnce { + failedOnce = true + return (503, #"{"error":"busy"}"#) + } + return (201, uploadFixture("id-" + name)) + case "/v1/agents/a1/messages": return (202, executionFixture()) + default: return (404, "") + } + } + defer { model.cancelStream(preservingWork: false) } + let files = ["a.txt", "b.txt"].map { PendingAttachment(name: $0, mimeType: "text/plain", data: Data($0.utf8)) } + model.draft = "Both" + model.attachments = files + await model.sendMessage()?.value + guard let failed = model.messages.last, failed.deliveryState == .failed else { + Issue.record("The send should fail on the second upload") + return + } + #expect(requests("/v1/agents/a1/messages").isEmpty) + // Bot failures put the message back in the composer, as before. + #expect(model.draft == "Both") + #expect(model.attachments.map(\.id) == files.map(\.id)) + + model.retryMessage(failed) + await waitFor { !requests("/v1/agents/a1/messages").isEmpty } + let names = requests("/v1/agents/a1/files").compactMap { $0.value(forHTTPHeaderField: "X-File-Name") } + #expect(names == ["a.txt", "b.txt", "b.txt"]) + let body = bodies("/v1/agents/a1/messages").first + #expect(body?["files"] == .array([.string("id-a.txt"), .string("id-b.txt")])) + #expect(body?["requestId"] == .string(failed.requestId ?? "")) + } + + @MainActor @Test func aDeletedFileRejectionUploadsAgainWhileAmbiguousFailuresReuseUploads() async { + var uploads = 0 + var sends = 0 + let model = await botChat { request in + switch request.url?.path { + case "/v1/agents/a1/files": + uploads += 1 + return (201, uploadFixture("f\(uploads)")) + case "/v1/agents/a1/messages": + sends += 1 + switch sends { + case 1: return (503, #"{"error":"busy"}"#) + case 2: return (400, #"{"error":"notes.txt was deleted from the library"}"#) + default: return (202, executionFixture()) + } + default: return (404, "") + } + } + defer { model.cancelStream(preservingWork: false) } + model.attachments = [PendingAttachment(name: "notes.txt", mimeType: "text/plain", data: Data("n".utf8))] + await model.sendMessage()?.value + for attempt in 2...3 { + guard let failed = model.messages.last, failed.deliveryState == .failed else { + Issue.record("Attempt \(attempt - 1) should fail") + return + } + model.retryMessage(failed) + await waitFor { requests("/v1/agents/a1/messages").count == attempt } + } + let sent = bodies("/v1/agents/a1/messages") + #expect(sent.map { $0["files"] } == [ + .array([.string("f1")]), .array([.string("f1")]), .array([.string("f2")]) + ]) + #expect(Set(sent.compactMap { $0["requestId"] }).count == 1) + #expect(requests("/v1/agents/a1/files").map(\.httpBody) == [Data("n".utf8), Data("n".utf8)]) + } + + @MainActor @Test func deletedTranscriptFilesHideCachedImagesAndAreNeverFetched() async { + let model = await botChat { _ in (404, "") } + defer { model.cancelStream(preservingWork: false) } + StubProtocol.files["/v1/agents/a1/files/f1"] = pngData() + model.applySnapshot(ChatSnapshot(messages: [imageMessage("1", file: dot)], status: "idle", agentId: "a1")) + await model.loadAttachmentImage(entryID: "a1:1", index: 0) + #expect(requests("/v1/agents/a1/files/f1").count == 1) + #expect(model.messages.first.flatMap { model.attachmentImage(message: $0, index: 0) } != nil) + + // A newer message lists the same file as deleted; the older one stops showing it at once. + model.applySnapshot(ChatSnapshot( + messages: [imageMessage("1", file: dot), imageMessage("2", file: .deleted("f1"))], + status: "idle", agentId: "a1")) + #expect(model.messages.map { $0.attachments?.first?.deleted } == [true, true]) + #expect(model.messages.allSatisfy { model.attachmentImage(message: $0, index: 0) == nil }) + await model.loadAttachmentImage(entryID: "a1:1", index: 0) + await model.loadAttachmentImage(entryID: "a1:2", index: 0) + #expect(requests("/v1/agents/a1/files/f1").count == 1) + #expect(!StubProtocol.requests.contains { $0.url?.path.contains("/attachments/") == true }) + } + + @MainActor @Test func aDownloadThatFinishesAfterDeletionIsNotShown() async { + let (client, controller) = ControlledDeliveryProtocol.client() + let model = AppModel(client: client) + defer { model.cancelStream(preservingWork: false) } + model.selectAgent("a1") + await waitFor { model.snapshot != nil } + model.applySnapshot(ChatSnapshot(messages: [imageMessage("1", file: dot)], status: "idle", agentId: "a1")) + await controller.hold("/v1/agents/a1/files/f1") + let download = Task { await model.loadAttachmentImage(entryID: "a1:1", index: 0) } + #expect(await controller.waitForHeld("/v1/agents/a1/files/f1")) + model.applySnapshot(ChatSnapshot( + messages: [imageMessage("1", file: .deleted("f1"))], status: "idle", agentId: "a1")) + await controller.release("/v1/agents/a1/files/f1", data: pngData()) + await download.value + #expect(model.attachmentImages.isEmpty) + } + + @MainActor @Test func groupAttachmentsUploadToTheGroupAndDownloadByFileID() async { + let model = AppModel(client: StubProtocol.client { request in + switch request.url?.path { + case "/v1/group-chats/trip/chat": (200, tripFixture) + case "/v1/group-chats/trip/events": (200, "") + case "/v1/group-chats/trip/files": (201, uploadFixture("g2")) + case "/v1/group-chats/trip/messages": (201, #"{"requestId":"r","entryId":"trip:2"}"#) + default: (404, "") + } + }) + defer { model.leaveGroup() } + StubProtocol.files["/v1/group-chats/trip/files/g1"] = pngData() + model.selectGroup("trip") + await waitFor { model.groupSnapshot != nil } + await model.loadAttachmentImage(entryID: "trip:1", index: 0) + #expect(requests("/v1/group-chats/trip/files/g1").count == 1) + #expect(model.messages.first.flatMap { model.attachmentImage(message: $0, index: 0) } != nil) + + let route = pngData() + model.attachments = [PendingAttachment(name: "route.png", mimeType: "image/png", data: route)] + model.replyTo = model.messages.first + await model.sendGroupMessage()?.value + #expect(requests("/v1/group-chats/trip/files").first?.httpBody == route) + let body = bodies("/v1/group-chats/trip/messages").first + #expect(body?["files"] == .array([.string("g2")])) + #expect(body?["replyTo"] == .string("trip:1")) + // Until the snapshot confirms it, the row shows the image from the bytes it kept. + #expect(model.messages.last.flatMap { model.attachmentImage(message: $0, index: 0) } != nil) + } + + @MainActor @Test func anUploadFromAPreviousConnectionNeitherSendsNorChangesTheNewOne() async { + let (client, controller) = ControlledDeliveryProtocol.client() + let model = AppModel(client: client) + defer { model.cancelStream(preservingWork: false) } + model.selectAgent("a1") + await waitFor { model.snapshot != nil } + await controller.hold("/v1/agents/a1/files") + model.attachments = [PendingAttachment(name: "notes.txt", mimeType: "text/plain", data: Data("n".utf8))] + let send = model.sendMessage() + #expect(await controller.waitForHeld("/v1/agents/a1/files")) + + let (next, _) = ControlledDeliveryProtocol.client() + model.applyConnection(next) + model.draft = "On the new server" + await controller.release("/v1/agents/a1/files", body: uploadFixture("f1"), status: 201) + await send?.value + #expect(await controller.observedPostCount() == 0) + #expect(model.messages.isEmpty) + #expect(model.draft == "On the new server") + #expect(model.attachments.isEmpty) + #expect(model.errorText.isEmpty) + } +} diff --git a/macos/Tests/CrumbleTests/GroupChatTests.swift b/macos/Tests/CrumbleTests/GroupChatTests.swift index 08c7977..1be8186 100644 --- a/macos/Tests/CrumbleTests/GroupChatTests.swift +++ b/macos/Tests/CrumbleTests/GroupChatTests.swift @@ -169,7 +169,8 @@ extension APIClientTests { @MainActor @Test func groupStreamSnapshotsReachTheTranscript() async { let streamed = groupSnapshotFixture.replacingOccurrences( of: #""messages":[]"#, - with: #""messages":[{"id":"trip:1:0","entryId":"trip:1","role":"assistant","content":"From the stream","# + with: #""messages":[{"id":"trip:1:0","entryId":"trip:1","# + + #""replyReferences":[],"role":"assistant","content":"From the stream","# + #""origin":{"kind":"bot","agentId":"a1","name":"Ada"}}]"# ).replacingOccurrences(of: "\n", with: "") let model = AppModel(client: StubProtocol.client { request in diff --git a/macos/Tests/CrumbleTests/JobTests.swift b/macos/Tests/CrumbleTests/JobTests.swift index b9a3ecc..2cacecd 100644 --- a/macos/Tests/CrumbleTests/JobTests.swift +++ b/macos/Tests/CrumbleTests/JobTests.swift @@ -12,8 +12,14 @@ extension APIClientTests { } } + private func tasks(in history: JobHistory) -> [String] { + history.items.compactMap { if case .task(let task) = $0 { task.text } else { nil } } + } + @Test func codingJobHistoryEncodesNameAndPaging() async throws { - let client = StubProtocol.client { _ in (200, #"{"messages":[],"hasMore":false,"oldestEntryId":null}"#) } + let client = StubProtocol.client { _ in + (200, #"{"items":[],"messages":[],"hasMore":false,"oldestEntryId":null}"#) + } _ = try await client.codingJobHistory("a1", name: "fix login/ui", before: "e:1", limit: 50) let url = StubProtocol.requests.first?.url?.absoluteString #expect(url == "http://crumble.test/v1/agents/a1/coding-jobs/fix%20login%2Fui/history?limit=50&before=e%3A1") @@ -35,14 +41,16 @@ extension APIClientTests { @MainActor @Test func openingACodingJobLoadsItsHistory() async { let model = AppModel(client: StubProtocol.client { request in request.url?.path == "/v1/agents/a1/coding-jobs/fix/history" - ? (200, #"{"messages":[{"id":"a1:1:0","entryId":"a1:1","role":"user","content":"Fix it"}],"hasMore":true,"# + ? (200, #"{"items":[{"kind":"task","id":"a1:1:0","text":"Fix it"}],"# + + #""messages":[{"id":"a1:1:0","entryId":"a1:1","# + + #""replyReferences":[],"role":"user","content":"Fix it"}],"hasMore":true,"# + #""oldestEntryId":"a1:1"}"#) : (404, "") }) model.selectedAgentID = "a1" model.openJob(.coding, "fix") await waitForJobs { model.jobHistory?.loaded == true } - #expect(model.jobHistory?.messages.map(\.text) == ["Fix it"]) + #expect(model.jobHistory.map { tasks(in: $0) } == ["Fix it"]) #expect(model.jobHistory?.hasMore == true) #expect(model.jobHistory?.oldestEntryID == "a1:1") } @@ -80,7 +88,9 @@ extension APIClientTests { (200, #"{"jobs":[{"name":"github","conversationId":"c2","status":"\#(status)","# + #""usage":{"models":{"m":{"input":1000,"output":500,"cacheRead":0,"cost":{"total":0.002}}}}}]}"#) case "/v1/agents/a1/desktop-jobs/github/history": - (200, #"{"messages":[{"id":"a1:3:0","entryId":"a1:3","role":"user","content":"Log in"}],"# + (200, #"{"items":[{"kind":"task","id":"a1:3:0","text":"Log in"}],"# + + #""messages":[{"id":"a1:3:0","entryId":"a1:3","# + + #""replyReferences":[],"role":"user","content":"Log in"}],"# + #""hasMore":false,"oldestEntryId":null}"#) default: (404, "") @@ -105,7 +115,7 @@ extension APIClientTests { model.openJob(.desktop, "github") await waitForJobs { model.jobHistory?.loaded == true } - #expect(model.jobHistory?.messages.map(\.text) == ["Log in"]) + #expect(model.jobHistory.map { tasks(in: $0) } == ["Log in"]) } private static let questionJob = @@ -134,7 +144,8 @@ extension APIClientTests { @Test func aTranscriptPageKeepsTheJobQuestionOfItsEvent() async throws { let client = StubProtocol.client { _ in - (200, #"{"messages":[{"id":"m","entryId":"e","role":"event","kind":"job-question","content":"Which?","# + (200, #"{"messages":[{"id":"m","entryId":"e","# + + #""replyReferences":[],"role":"event","kind":"job-question","content":"Which?","# + #""jobQuestion":{"id":"q1","kind":"coding","job":"fix"}}],"hasMore":false,"oldestEntryId":null}"#) } let page = try await client.chatHistory("a1", before: "", limit: 50) @@ -193,9 +204,11 @@ extension APIClientTests { let model = AppModel(client: StubProtocol.client { request in guard request.url?.path == "/v1/agents/a1/coding-jobs/fix/history" else { return (404, "") } return request.url?.query?.contains("before=") == true - ? (200, #"{"messages":[{"id":"1","entryId":"e1","role":"user","content":"First"}],"hasMore":false,"# + ? (200, #"{"items":[],"messages":[{"id":"1","entryId":"e1","# + + #""replyReferences":[],"role":"user","content":"First"}],"hasMore":false,"# + #""oldestEntryId":null}"#) - : (200, #"{"messages":[{"id":"2","entryId":"e2","role":"user","content":"Second"}],"hasMore":true,"# + : (200, #"{"items":[],"messages":[{"id":"2","entryId":"e2","# + + #""replyReferences":[],"role":"user","content":"Second"}],"hasMore":true,"# + #""oldestEntryId":"e2"}"#) }) model.selectedAgentID = "a1" diff --git a/macos/Tests/CrumbleTests/LogicTests.swift b/macos/Tests/CrumbleTests/LogicTests.swift index 0e4bb27..89a94d8 100644 --- a/macos/Tests/CrumbleTests/LogicTests.swift +++ b/macos/Tests/CrumbleTests/LogicTests.swift @@ -14,7 +14,7 @@ struct LogicTests { let second = Agent(id: "a2", name: "Beacon") model.selectedAgentID = first.id model.route = .agent(first.id) - model.applySnapshot(ChatSnapshot(status: "running", agentId: first.id)) + model.applySnapshot(ChatSnapshot(status: "running", working: .thinking, agentId: first.id)) #expect(model.botState(first) == .working) model.selectedAgentID = second.id @@ -75,10 +75,11 @@ struct LogicTests { } @Test func chatHidesToolActivity() { - let tool = Message(id: "a1:1:0", role: "assistant", blocks: .array([.object(["type": .string("toolCall")])])) + let tool = Message( + id: "a1:1:0", role: "assistant", + blocks: [.toolCall(.init(arguments: .init(), id: "c", name: "bash", _type: .toolCall))]) let reply = Message( - id: "a1:1:1", role: "assistant", content: .string("Hi"), - blocks: .array([.object(["type": .string("text"), "text": .string("Hi")])])) + id: "a1:1:1", role: "assistant", content: .string("Hi"), blocks: [.text(.init(text: "Hi", _type: .text))]) #expect(!shownInChat(tool)) #expect(shownInChat(reply)) } @@ -183,7 +184,8 @@ struct LogicTests { @Test func chatRowsKeepPartialAssistantTextHiddenUntilCompletion() throws { let rows = ChatRow.rows( - messages: [], snapshot: ChatSnapshot(status: "running", partial: "draft"), hasMore: false) + messages: [], snapshot: ChatSnapshot(status: "running", working: .writing, partial: "draft"), + hasMore: false) #expect(rows.count == 1) guard case .thinking = rows[0] else { diff --git a/macos/Tests/CrumbleTests/OptimisticChatTests.swift b/macos/Tests/CrumbleTests/OptimisticChatTests.swift index b1b4a4c..0f3f0e7 100644 --- a/macos/Tests/CrumbleTests/OptimisticChatTests.swift +++ b/macos/Tests/CrumbleTests/OptimisticChatTests.swift @@ -42,7 +42,7 @@ extension APIClientTests { let second = Agent(id: "a2", name: "Beacon") model.selectedAgentID = first.id model.route = .agent(first.id) - model.applySnapshot(ChatSnapshot(status: "running", agentId: first.id)) + model.applySnapshot(ChatSnapshot(status: "running", working: .thinking, agentId: first.id)) model.selectAgent(second.id) #expect(model.botState(first) == .working) await waitUntil { model.botState(first) == .idle && model.snapshot?.agentId == second.id }