diff --git a/README.md b/README.md index 22e75c01b..85af5d71e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,16 @@ npm i @digitalocean/dots https://digitaloceandots.readthedocs.io/en/latest/ +#### **Action Gateway** + +Use `@digitalocean/dots/action_gateway` for session-bound tools with Chat +Completions, Messages, and Responses. Toolbelt CRUD is generated from the +public DigitalOcean OpenAPI specification, with a `createToolbelt` convenience +method on `ActionGatewayClient`. + +See the [Action Gateway guide](docs/action-gateway.md) and +[TypeScript examples](examples/action-gateway/). + ## **Basic Usage** > A quick guide to getting started with client #### Authenticating diff --git a/docs/action-gateway.md b/docs/action-gateway.md new file mode 100644 index 000000000..865ee2712 --- /dev/null +++ b/docs/action-gateway.md @@ -0,0 +1,94 @@ +# Action Gateway + +The TypeScript SDK uses a session-first Action Gateway flow. Create a session +on the DigitalOcean public API, then discover or invoke tools through the +returned session MCP URL with authentication and actor headers managed by the +SDK. + +```ts +import { ActionGatewayClient } from "@digitalocean/dots/action_gateway"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); +const session = await gateway.session.create({ actorId: "end-user-123" }); +``` + +Session creation sends `actor_id`, `name`, and typed `policy` to +`POST /v2/action-gateway/sessions`. The default policy action is `ask`. Use the +optional `tools` field to select tools (omit it for all tools, or pass `[]` for +none) and `config.preloadTools` to expose concrete tools alongside the three +meta-tools on the returned MCP endpoint. + +```ts +const session = await gateway.session.create({ + actorId: "end-user-123", + tools: ["exa_web_search@v1"], + config: { preloadTools: ["exa_web_search@v1"] }, +}); + +console.log(session.url); // API-returned mcpUrl +``` + +The controls are complementary: top-level `tools` selects the catalog visible +to `action_search` and callable through `action_invoke`, `config.preloadTools` +also exposes selected concrete tools directly, and `permissions` applies +`allow`, `ask`, or `deny` when any selected tool is invoked. See +`examples/action-gateway/session-controls.ts` for a complete configuration. + +If a policy returns a pending approval, decide it and retry the invocation: + +```ts +await session.approve(approvalId); +// or: await session.deny(approvalId); +``` + +## Inference API formats + +Select the inference API when creating the client so `session.tools()` and +`session.handleToolCalls()` use the matching wire format. The default is +`chat.completions`; Responses uses top-level `name` and `parameters` fields: + +```ts +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, + provider: "responses", +}); +const session = await gateway.session.create({ actorId: "end-user-123" }); + +const response = await gateway.responses.create({ + model: "openai-gpt-4o", + input: "Find the latest DigitalOcean news and summarize it.", + tools: await session.tools(), +}); + +const toolOutputs = await session.handleToolCalls(response); +``` + +Use `provider: "messages"` for the Messages API. Provider instances remain +supported for custom integrations. + +## Toolbelts + +Toolbelts are public DigitalOcean API resources, so CRUD operations are +generated from the public OpenAPI specification under `gateway.toolbelts`. +`createToolbelt` is the Action Gateway convenience wrapper: + +```ts +const toolbelt = await gateway.createToolbelt({ + name: "search-toolbelt", + tools: ["exa_web_search", "exa_web_fetch"], +}); + +const session = await gateway.session.create({ + actorId: "end-user-123", + permissions: { + defaultAction: "ask", + rules: [{ tool: `toolbelt:${toolbelt.ref}`, action: "allow" }], + }, +}); +``` + +See `examples/action-gateway/` for Chat Completions, Messages, Responses, +direct tool and code execution, asynchronous usage, toolbelt creation, and +toolbelt policy examples. diff --git a/examples/action-gateway/async.ts b/examples/action-gateway/async.ts new file mode 100644 index 000000000..e268c3cfe --- /dev/null +++ b/examples/action-gateway/async.ts @@ -0,0 +1,13 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); +const session = await gateway.session.create({ actorId: "end-user-123" }); + +const [tools, catalog] = await Promise.all([ + session.tools(), + session.toolsOperations.list({ includeAll: true }), +]); + +console.log(`Loaded ${tools.length} model tools and ${catalog.length} session tools.`); diff --git a/examples/action-gateway/chat-completions.ts b/examples/action-gateway/chat-completions.ts new file mode 100644 index 000000000..a87055164 --- /dev/null +++ b/examples/action-gateway/chat-completions.ts @@ -0,0 +1,36 @@ +import { Client } from "../../src/inference-gen/inference.js"; +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const apiKey = process.env.DIGITALOCEAN_TOKEN!; +const inference = new Client({ apiKey }); +const gateway = new ActionGatewayClient({ apiKey }); +const session = await gateway.session.create({ + actorId: "end-user-123", + permissions: { + defaultAction: "ask", + rules: [ + { tool: "exa_web_search", action: "allow" }, + { tool: "exa_web_fetch", action: "allow" }, + ], + }, +}); + +const messages: Record[] = [{ + role: "user", + content: "Find the latest DigitalOcean news and summarize it.", +}]; + +while (true) { + const response = await inference.chat.completions.create({ + model: "llama3.3-70b-instruct", + messages, + tools: await session.tools(), + }); + const message = response.choices[0].message; + messages.push(message); + if (!message.tool_calls?.length) { + console.log(message.content); + break; + } + messages.push(...await session.handleToolCalls(response)); +} diff --git a/examples/action-gateway/create-toolbelt.ts b/examples/action-gateway/create-toolbelt.ts new file mode 100644 index 000000000..2fc536d62 --- /dev/null +++ b/examples/action-gateway/create-toolbelt.ts @@ -0,0 +1,27 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); + +const toolbelt = await gateway.createToolbelt({ + name: "search-toolbelt", + tools: ["exa_web_search", "exa_web_fetch"], +}); + +console.log(toolbelt.ref); // search-toolbelt@1 + +// The base CRUD surface is generated from the public OpenAPI specification. +await gateway.toolbelts.get({ queryParameters: { status: "active" } }); +await gateway.toolbelts.byName("search-toolbelt").get({ + queryParameters: { version: "1" }, +}); +await gateway.toolbelts.byName("search-toolbelt").tools.add.post({ + tools: ["jira_create_issue"], +}); +await gateway.toolbelts.byName("search-toolbelt").tools.remove.post({ + tools: ["exa_web_fetch"], +}); + +// Delete the toolbelt when it is no longer needed. +// await gateway.toolbelts.byName("search-toolbelt").delete(); diff --git a/examples/action-gateway/direct-tools.ts b/examples/action-gateway/direct-tools.ts new file mode 100644 index 000000000..93e0486e5 --- /dev/null +++ b/examples/action-gateway/direct-tools.ts @@ -0,0 +1,26 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); +const session = await gateway.session.create({ + actorId: "end-user-123", + tools: ["exa_web_search@v1", "execute_code@v1"], + config: { preloadTools: ["exa_web_search@v1"] }, + permissions: { + defaultAction: "ask", + rules: [ + { tool: "exa_web_search", action: "allow" }, + { tool: "execute_code", action: "allow" }, + ], + }, +}); + +const search = await session.toolsOperations.search("search the web for DigitalOcean news"); +const result = await session.toolsOperations.invokeOne("exa_web_search", { + query: "DigitalOcean news", + max_results: 5, +}); +const code = await session.code.execute("print(sum(range(10)))"); + +console.dir({ search, result, code }, { depth: null }); diff --git a/examples/action-gateway/messages.ts b/examples/action-gateway/messages.ts new file mode 100644 index 000000000..a36320a2a --- /dev/null +++ b/examples/action-gateway/messages.ts @@ -0,0 +1,31 @@ +import { Client } from "../../src/inference-gen/inference.js"; +import { + ActionGatewayClient, + MessagesProvider, +} from "../../src/action-gateway/index.js"; + +const apiKey = process.env.DIGITALOCEAN_TOKEN!; +const inference = new Client({ apiKey }); +const gateway = new ActionGatewayClient({ + apiKey, + provider: new MessagesProvider(), +}); +const session = await gateway.session.create({ + actorId: "end-user-123", + permissions: { + defaultAction: "ask", + rules: [ + { tool: "exa_web_search", action: "allow" }, + { tool: "exa_web_fetch", action: "allow" }, + ], + }, +}); + +const response = await inference.messages.create({ + model: "anthropic-claude-sonnet-4", + max_tokens: 1024, + messages: [{ role: "user", content: "Find the latest DigitalOcean news." }], + tools: await session.tools(), +}); + +console.dir(await session.handleToolCalls(response), { depth: null }); diff --git a/examples/action-gateway/public-api.ts b/examples/action-gateway/public-api.ts new file mode 100644 index 000000000..0b6e7413d --- /dev/null +++ b/examples/action-gateway/public-api.ts @@ -0,0 +1,78 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; +import type { Create_connection_request } from "../../src/dots/models/index.js"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); +const actorId = process.env.ACTOR_ID ?? "example-user"; + +// Public Tool Registry APIs are generated from DigitalOcean's OpenAPI spec. +console.log("Tools:", await gateway.tools.get({ + queryParameters: { toolkitId: "exa" }, +})); +console.log("Toolkits:", await gateway.tools.toolkits.get()); +console.log("Providers:", await gateway.tools.providers.get()); +console.log("Definition:", await gateway.tools.byName("exa_web_search").definition.get({ + queryParameters: { version: "v1" }, +})); + +// Toolbelts support create, list, get, membership changes, and delete. +console.log("Created toolbelt:", await gateway.toolbelts.post({ + name: "search-toolbelt", + tools: ["exa_web_search"], +})); +console.log("Toolbelts:", await gateway.toolbelts.get({ + queryParameters: { status: "active" }, +})); +const toolbelt = gateway.toolbelts.byName("search-toolbelt"); +console.log("Toolbelt:", await toolbelt.get()); +await toolbelt.tools.add.post({ tools: ["exa_web_fetch"] }); +await toolbelt.tools.remove.post({ tools: ["exa_web_fetch"] }); + +// Connections support create, list, get, parameter updates, and delete. +const connectionRequest: Create_connection_request = { + provider: "github", + userId: actorId, + scopes: ["repo"], +}; +console.log("Created connection:", await gateway.connections.post(connectionRequest)); +console.log("Connections:", await gateway.connections.get({ + queryParameters: { userId: actorId }, +})); + +const connectionId = process.env.CONNECTION_ID; +if (connectionId) { + const connection = gateway.connections.byId(connectionId); + console.log("Connection:", await connection.get()); + await connection.patch({ + connectionParameters: { + additionalData: { site_url: "https://github.com" }, + }, + }); + await connection.delete(); +} + +// Users are derived from their sessions and connections. +console.log("Users:", await gateway.users.get()); +console.log("User:", await gateway.users.byUser_id(actorId).get()); + +// The convenience API delegates session creation to the generated resource +// and returns a session bound to response.mcpUrl. +console.log("Sessions:", await gateway.sessionsApi.get({ + queryParameters: { endUserId: actorId }, +})); +const session = await gateway.session.create({ + actorId, + tools: ["exa_web_search@v1"], + config: { preloadTools: ["exa_web_search@v1"] }, + permissions: { defaultAction: "ask" }, +}); +console.log("Session MCP URL:", session.url); + +const sessionUrn = process.env.SESSION_URN; +if (sessionUrn) { + await gateway.sessionsApi.bySession_urn(sessionUrn).delete(); +} + +// Uncomment when the example toolbelt is no longer needed. +// await toolbelt.delete(); diff --git a/examples/action-gateway/responses.ts b/examples/action-gateway/responses.ts new file mode 100644 index 000000000..706cdfbf9 --- /dev/null +++ b/examples/action-gateway/responses.ts @@ -0,0 +1,22 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const apiKey = process.env.DIGITALOCEAN_TOKEN!; +const gateway = new ActionGatewayClient({ + apiKey, + provider: "responses", +}); +const session = await gateway.session.create({ + actorId: "end-user-123", + permissions: { + defaultAction: "ask", + rules: [{ tool: "exa_web_search", action: "allow" }], + }, +}); + +const response = await gateway.responses.create({ + model: "openai-gpt-4o", + input: "Find the latest DigitalOcean news and summarize it.", + tools: await session.tools(), +}); + +console.dir(await session.handleToolCalls(response), { depth: null }); diff --git a/examples/action-gateway/session-controls.ts b/examples/action-gateway/session-controls.ts new file mode 100644 index 000000000..4e44b6c6a --- /dev/null +++ b/examples/action-gateway/session-controls.ts @@ -0,0 +1,28 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); +const session = await gateway.session.create({ + actorId: "end-user-123", + + tools: ["exa_web_search@v1", "exa_web_fetch@v1"], + config: { preloadTools: ["exa_web_search@v1"] }, + permissions: { + defaultAction: "deny", + rules: [ + { tool: "exa_web_search", action: "allow" }, + { tool: "exa_web_fetch", action: "ask" }, + ], + }, +}); + +console.log("MCP URL:", session.url); +console.log("Selected for search/invoke:", session.selectedTools); +console.log( + "Exposed directly:", + (await session.toolsOperations.list({ includeAll: true })).map((tool) => tool.name), +); + +const results = await session.toolsOperations.search("search or fetch a public web page"); +console.dir(results, { depth: null }); diff --git a/examples/action-gateway/toolbelt-policy.ts b/examples/action-gateway/toolbelt-policy.ts new file mode 100644 index 000000000..1ed78cbfa --- /dev/null +++ b/examples/action-gateway/toolbelt-policy.ts @@ -0,0 +1,19 @@ +import { ActionGatewayClient } from "../../src/action-gateway/index.js"; + +const gateway = new ActionGatewayClient({ + apiKey: process.env.DIGITALOCEAN_TOKEN!, +}); +const toolbelt = await gateway.createToolbelt({ + name: "search-toolbelt", + tools: ["exa_web_search", "exa_web_fetch"], +}); + +const session = await gateway.session.create({ + actorId: "end-user-123", + permissions: { + defaultAction: "ask", + rules: [{ tool: `toolbelt:${toolbelt.ref}`, action: "allow" }], + }, +}); + +console.log(session.url); diff --git a/package.json b/package.json index 21f3bbb79..0e694fada 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "main": "index.js", "exports": { ".": "./index.js", + "./action_gateway": "./src/action-gateway/index.js", "./inference": "./src/inference-gen/inference.js", "./package.json": "./package.json", "./*": "./*" diff --git a/src/action-gateway/index.ts b/src/action-gateway/index.ts new file mode 100644 index 000000000..231e436f6 --- /dev/null +++ b/src/action-gateway/index.ts @@ -0,0 +1,818 @@ +import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary"; + +import { DigitalOceanApiKeyAuthenticationProvider } from "../dots/DigitalOceanApiKeyAuthenticationProvider.js"; +import { createDigitalOceanClient } from "../dots/digitalOceanClient.js"; +import type { + Create_session_request, + Create_session_request_config, + Session_policy_rule, + Session_policy_spec, + Toolbelt, + Toolbelt_create, +} from "../dots/models/index.js"; +import type { ConnectionsRequestBuilder } from "../dots/v2/actionGateway/connections/index.js"; +import type { SessionsRequestBuilder } from "../dots/v2/actionGateway/sessions/index.js"; +import type { ToolbeltsRequestBuilder } from "../dots/v2/actionGateway/toolbelts/index.js"; +import type { ToolsRequestBuilder } from "../dots/v2/actionGateway/tools/index.js"; +import type { UsersRequestBuilder } from "../dots/v2/actionGateway/users/index.js"; +import { + InferenceClient, + type InferenceClientOptions, +} from "../inference-gen/InferenceClient.js"; + +export const DEFAULT_API_BASE_URL = "https://api.digitalocean.com"; +export const SESSION_ID_HEADER = "X-Session-Id"; +export const ACTOR_ID_HEADER = "X-Actor-Id"; +export const MCP_PROTOCOL_VERSION = "2025-06-18"; + +export const META_SEARCH = "action_search"; +export const META_INVOKE = "action_invoke"; +export const META_CODE = "action_code"; + +type JsonObject = Record; + +export interface PermissionRule { + tool: string; + action?: "allow" | "ask" | "deny" | string; + match?: Record; +} + +export interface Permissions { + defaultAction?: "allow" | "ask" | "deny" | string; + default_action?: "allow" | "ask" | "deny" | string; + rules?: PermissionRule[]; +} + +export interface CreateSessionOptions { + actorId: string; + name?: string; + permissions?: Permissions; + tools?: string[]; + config?: JsonObject; +} + +export interface CreateToolbeltOptions { + name: string; + tools: string[]; + version?: string; + displayName?: string; + description?: string; +} + +export type ToolbeltWithRef = Toolbelt & { readonly ref: string }; + +export interface ActionGatewayClientOptions extends InferenceClientOptions { + apiBaseURL?: string; + provider?: GatewayProvider | GatewayProviderName; +} + +export interface ToolDefinition { + name: string; + title?: string; + description?: string; + inputSchema?: JsonObject; + [key: string]: unknown; +} + +export interface ToolCall { + callId: string; + name: string; + arguments: JsonObject; +} + +export interface SessionToolsOptions { + includeAll?: boolean; + names?: string[]; + search?: string | SearchQuery | Array; + providers?: string[]; + tags?: string[]; + limit?: number; +} + +export interface SearchQuery { + use_case: string; + known_fields?: string; +} + +export interface SearchOptions { + providers?: string[]; + tags?: string[]; + limit?: number; +} + +export interface InvokeTool { + tool?: string; + toolSlug?: string; + arguments?: JsonObject; +} + +export interface InvokeOptions { + rationale?: string; +} + +export type ToolResultMessage = JsonObject; + +export type GatewayProviderName = "chat.completions" | "messages" | "responses"; + +export interface GatewayProvider { + readonly name: string; + wrapTools(tools: ToolDefinition[]): JsonObject[]; + extractToolCalls(response: unknown): ToolCall[]; + formatToolResults(calls: ToolCall[], results: unknown[]): ToolResultMessage[]; +} + +export class GatewayError extends Error { + public constructor( + message: string, + public readonly status?: number, + public readonly body?: unknown, + ) { + super(message); + this.name = "GatewayError"; + } +} + +function asObject(value: unknown): JsonObject { + return value !== null && typeof value === "object" ? value as JsonObject : {}; +} + +function asArray(value: unknown): unknown[] { + return Array.isArray(value) ? value : []; +} + +function parseArguments(value: unknown): JsonObject { + if (typeof value === "string") { + if (!value.trim()) return {}; + return asObject(JSON.parse(value)); + } + return asObject(value); +} + +function stringifyResult(value: unknown): string { + return typeof value === "string" ? value : JSON.stringify(value); +} + +function simplifySchema(schema: unknown): JsonObject { + const simplified = structuredClone(asObject(schema)); + for (const key of ["oneOf", "allOf", "anyOf", "enum", "const", "not"]) { + delete simplified[key]; + } + simplified.type ??= "object"; + if (simplified.type === "object") simplified.properties ??= {}; + return simplified; +} + +function toolFields(tool: ToolDefinition): JsonObject { + return { + name: tool.name, + description: tool.description ?? tool.title ?? "", + parameters: simplifySchema(tool.inputSchema), + }; +} + +export class ChatCompletionsProvider implements GatewayProvider { + public readonly name = "chat.completions"; + + public wrapTools(tools: ToolDefinition[]): JsonObject[] { + return tools.map((tool) => ({ type: "function", function: toolFields(tool) })); + } + + public extractToolCalls(response: unknown): ToolCall[] { + const choice = asObject(asArray(asObject(response).choices)[0]); + const message = asObject(choice.message); + return asArray(message.tool_calls).map((value) => { + const call = asObject(value); + const functionCall = asObject(call.function); + return { + callId: String(call.id ?? ""), + name: String(functionCall.name ?? ""), + arguments: parseArguments(functionCall.arguments), + }; + }); + } + + public formatToolResults(calls: ToolCall[], results: unknown[]): ToolResultMessage[] { + return calls.map((call, index) => ({ + role: "tool", + tool_call_id: call.callId, + content: stringifyResult(results[index]), + })); + } +} + +export class MessagesProvider implements GatewayProvider { + public readonly name = "messages"; + + public wrapTools(tools: ToolDefinition[]): JsonObject[] { + return tools.map((tool) => { + const fields = toolFields(tool); + return { + name: fields.name, + description: fields.description, + input_schema: fields.parameters, + }; + }); + } + + public extractToolCalls(response: unknown): ToolCall[] { + return asArray(asObject(response).content) + .map(asObject) + .filter((block) => block.type === "tool_use") + .map((block) => ({ + callId: String(block.id ?? ""), + name: String(block.name ?? ""), + arguments: parseArguments(block.input), + })); + } + + public formatToolResults(calls: ToolCall[], results: unknown[]): ToolResultMessage[] { + if (calls.length === 0) return []; + return [{ + role: "user", + content: calls.map((call, index) => ({ + type: "tool_result", + tool_use_id: call.callId, + content: stringifyResult(results[index]), + })), + }]; + } +} + +export class ResponsesProvider implements GatewayProvider { + public readonly name = "responses"; + + public wrapTools(tools: ToolDefinition[]): JsonObject[] { + return tools.map((tool) => ({ type: "function", ...toolFields(tool) })); + } + + public extractToolCalls(response: unknown): ToolCall[] { + return asArray(asObject(response).output) + .map(asObject) + .filter((item) => item.type === "function_call") + .map((item) => ({ + callId: String(item.call_id ?? item.id ?? ""), + name: String(item.name ?? ""), + arguments: parseArguments(item.arguments), + })); + } + + public formatToolResults(calls: ToolCall[], results: unknown[]): ToolResultMessage[] { + return calls.map((call, index) => ({ + type: "function_call_output", + call_id: call.callId, + output: stringifyResult(results[index]), + })); + } +} + +function resolveProvider(provider: GatewayProvider | GatewayProviderName | undefined): GatewayProvider { + if (provider === undefined || provider === "chat.completions") return new ChatCompletionsProvider(); + if (provider === "messages") return new MessagesProvider(); + if (provider === "responses") return new ResponsesProvider(); + return provider; +} + +function normalizeBaseURL(value: string): string { + const url = value.trim().replace(/\/+$/, ""); + return url.includes("://") ? url : `https://${url}`; +} + +function externalSessionId(sessionUrn: string): string { + return sessionUrn.split(":").at(-1) ?? sessionUrn; +} + +function normalizePermissions(permissions?: Permissions): Required> { + const rules = (permissions?.rules ?? []).map((rule) => { + if (!rule.tool) throw new Error("each permissions rule requires tool"); + return { + tool: rule.tool, + action: rule.action ?? "allow", + ...(rule.match ? { match: rule.match } : {}), + }; + }); + return { + defaultAction: permissions?.defaultAction ?? permissions?.default_action ?? "ask", + rules, + }; +} + +function toSessionPolicy(policy: Required>): Session_policy_spec { + return { + defaultAction: policy.defaultAction as Session_policy_spec["defaultAction"], + rules: policy.rules.map((rule): Session_policy_rule => ({ + tool: rule.tool, + action: rule.action as Session_policy_rule["action"], + ...(rule.match ? { match: { additionalData: rule.match } } : {}), + })), + }; +} + +function toSessionConfig(config: JsonObject): Create_session_request_config { + const { preloadTools, ...additionalData } = config; + return { + ...(preloadTools === undefined ? {} : { preloadTools: preloadTools as string[] }), + ...(Object.keys(additionalData).length === 0 ? {} : { additionalData }), + }; +} + +async function requestJSON( + url: string, + apiKey: string, + init: RequestInit, +): Promise { + const response = await fetch(url, { + ...init, + headers: { + Authorization: `Bearer ${apiKey}`, + Accept: "application/json", + "Content-Type": "application/json", + ...init.headers, + }, + }); + const text = await response.text(); + let body: unknown; + try { + body = text ? JSON.parse(text) : undefined; + } catch { + body = text; + } + if (!response.ok) { + const message = String(asObject(body).message ?? response.statusText ?? "request failed"); + throw new GatewayError(message, response.status, body); + } + return body; +} + +const META_TOOLS: ToolDefinition[] = [ + { + name: META_SEARCH, + title: "Action Search", + description: "Discover catalog tools for one or more use cases.", + inputSchema: { + type: "object", + properties: { + queries: { + type: "array", + minItems: 1, + maxItems: 5, + items: { + type: "object", + properties: { + use_case: { type: "string" }, + known_fields: { type: "string" }, + }, + required: ["use_case"], + }, + }, + providers: { type: "array", items: { type: "string" } }, + tags: { type: "array", items: { type: "string" } }, + limit: { type: "integer" }, + }, + required: ["queries"], + }, + }, + { + name: META_INVOKE, + title: "Action Invoke", + description: "Invoke one to ten catalog tools in parallel.", + inputSchema: { + type: "object", + properties: { + tools: { + type: "array", + minItems: 1, + maxItems: 10, + items: { + type: "object", + properties: { + tool: { type: "string" }, + arguments: { type: "object" }, + }, + required: ["tool"], + }, + }, + rationale: { type: "string", maxLength: 512 }, + }, + required: ["tools"], + }, + }, + { + name: META_CODE, + title: "Action Code", + description: "Run Python in an ephemeral sandbox.", + inputSchema: { + type: "object", + properties: { + code: { type: "string" }, + thought: { type: "string" }, + }, + required: ["code"], + }, + }, +]; + +class GatewayTransport { + public readonly sessionId: string; + private nextRequestId = 1; + + public constructor( + private readonly apiKey: string, + private readonly endpointURL: string, + sessionUrn: string, + private readonly actorId: string, + ) { + this.sessionId = externalSessionId(sessionUrn); + } + + public async callTool(name: string, arguments_: JsonObject): Promise { + const result = await this.rpc("tools/call", { name, arguments: arguments_ }); + return unwrapMCPToolResult(result); + } + + public async listTools(): Promise { + const result = asObject(await this.rpc("tools/list")); + return asArray(result.tools) as ToolDefinition[]; + } + + public async decideApproval(approvalId: string, decision: "approve" | "deny"): Promise { + const normalizedApprovalId = approvalId.trim(); + if (!normalizedApprovalId) throw new Error("approvalId is required"); + const origin = new URL(this.endpointURL).origin; + return requestJSON(`${origin}/approvals/${encodeURIComponent(normalizedApprovalId)}`, this.apiKey, { + method: "POST", + headers: { + [SESSION_ID_HEADER]: this.sessionId, + [ACTOR_ID_HEADER]: this.actorId, + }, + body: JSON.stringify({ decision }), + }); + } + + private async rpc(method: string, params?: JsonObject): Promise { + const response = await fetch(this.endpointURL, { + method: "POST", + headers: { + Authorization: `Bearer ${this.apiKey}`, + Accept: "application/json, text/event-stream", + "Content-Type": "application/json", + "MCP-Protocol-Version": MCP_PROTOCOL_VERSION, + [SESSION_ID_HEADER]: this.sessionId, + [ACTOR_ID_HEADER]: this.actorId, + }, + body: JSON.stringify({ + jsonrpc: "2.0", + id: this.nextRequestId++, + method, + ...(params === undefined ? {} : { params }), + }), + }); + const text = await response.text(); + const envelope = parseMCPEnvelope(text); + if (!response.ok) { + throw new GatewayError( + String(asObject(envelope).message ?? response.statusText ?? "request failed"), + response.status, + envelope, + ); + } + const error = asObject(asObject(envelope).error); + if (Object.keys(error).length > 0) { + throw new GatewayError(String(error.message ?? "MCP request failed"), undefined, error); + } + if (!("result" in asObject(envelope))) { + throw new GatewayError("MCP response is missing result", undefined, envelope); + } + return asObject(envelope).result; + } +} + +function parseMCPEnvelope(text: string): unknown { + if (!text.trim()) return undefined; + if (!text.split("\n").some((line) => line.startsWith("data:"))) return JSON.parse(text); + const events = text.split(/\r?\n\r?\n/); + for (const event of events) { + const data = event.split(/\r?\n/) + .filter((line) => line.startsWith("data:")) + .map((line) => line.slice(5).trimStart()) + .join("\n"); + if (!data) continue; + const candidate = JSON.parse(data); + if ("result" in asObject(candidate) || "error" in asObject(candidate)) return candidate; + } + throw new GatewayError("MCP response did not contain a JSON-RPC result"); +} + +function unwrapMCPToolResult(payload: unknown): unknown { + const result = asObject(payload); + if (result.isError) { + const structured = asObject(result.structuredContent); + const error = asObject(structured.error); + throw new GatewayError(String(error.message ?? contentText(result.content) ?? "tool call failed"), undefined, payload); + } + if ("structuredContent" in result) return result.structuredContent; + const text = contentText(result.content); + if (text === undefined) return payload; + try { + return JSON.parse(text); + } catch { + return text; + } +} + +function contentText(content: unknown): string | undefined { + const text = asArray(content) + .map(asObject) + .filter((item) => item.type === "text" && typeof item.text === "string") + .map((item) => String(item.text)) + .join("\n"); + return text || undefined; +} + +function unwrapToolResult(payload: unknown): unknown { + const result = asObject(payload); + if (result.status && result.status !== "succeeded") { + const error = asObject(result.error); + throw new GatewayError(String(error.message ?? "tool call failed"), undefined, payload); + } + if ("output" in result) { + if (typeof result.output === "string") { + try { + return JSON.parse(result.output); + } catch { + return result.output; + } + } + return result.output; + } + return payload; +} + +function toolErrorResult(error: GatewayError): JsonObject { + const body = asObject(error.body); + const structured = asObject(body.structuredContent); + const structuredError = asObject(structured.error); + const bodyError = asObject(body.error); + const details = Object.keys(structuredError).length > 0 ? structuredError : bodyError; + return { + error: Object.keys(details).length > 0 + ? { ...details, message: details.message ?? error.message } + : { message: error.message }, + ...(body._meta === undefined ? {} : { _meta: body._meta }), + }; +} + +function normalizeQueries(input: string | SearchQuery | Array): SearchQuery[] { + const queries = Array.isArray(input) ? input : [input]; + if (queries.length < 1 || queries.length > 5) { + throw new Error("search accepts between 1 and 5 queries"); + } + return queries.map((query) => typeof query === "string" ? { use_case: query } : query); +} + +export class ToolsOperations { + public constructor( + private readonly transport: GatewayTransport, + private readonly provider: GatewayProvider, + ) {} + + public async list(options: { includeAll?: boolean } = {}): Promise { + if (!options.includeAll) return structuredClone(META_TOOLS); + return this.transport.listTools(); + } + + public async search( + queries: string | SearchQuery | Array, + options: SearchOptions = {}, + ): Promise { + return this.transport.callTool(META_SEARCH, { + queries: normalizeQueries(queries), + ...(options.providers?.length ? { providers: options.providers } : {}), + ...(options.tags?.length ? { tags: options.tags } : {}), + ...(options.limit !== undefined ? { limit: options.limit } : {}), + }); + } + + public async invoke(tools: InvokeTool[], options: InvokeOptions = {}): Promise { + if (tools.length < 1 || tools.length > 10) { + throw new Error("invoke accepts between 1 and 10 tools"); + } + const normalized = tools.map((tool) => { + const name = tool.tool ?? tool.toolSlug; + if (!name) throw new Error("each invoke entry requires tool"); + return { tool: name, arguments: tool.arguments ?? {} }; + }); + return this.transport.callTool(META_INVOKE, { + tools: normalized, + ...(options.rationale ? { rationale: options.rationale } : {}), + }); + } + + public async invokeOne(name: string, arguments_: JsonObject = {}, options: InvokeOptions = {}): Promise { + const envelope = asObject(await this.invoke([{ tool: name, arguments: arguments_ }], options)); + const first = asObject(asArray(envelope.results)[0]); + if (Object.keys(first).length === 0) throw new GatewayError(`invoke of ${name} returned no results`); + return unwrapToolResult(first.result ?? first); + } + + public async definitions(options: SessionToolsOptions = {}): Promise { + let catalog: ToolDefinition[]; + if (options.search !== undefined) { + catalog = flattenSearchResults(await this.search(options.search, options)); + } else { + catalog = await this.list({ includeAll: options.includeAll || Boolean(options.names?.length) }); + } + if (options.names?.length) { + const names = new Set(options.names); + catalog = catalog.filter((tool) => names.has(tool.name)); + const missing = options.names.filter((name) => !catalog.some((tool) => tool.name === name)); + if (missing.length) throw new Error(`tools not found in catalog: ${missing.join(", ")}`); + } + return this.provider.wrapTools(catalog); + } +} + +function flattenSearchResults(payload: unknown): ToolDefinition[] { + const found = new Map(); + for (const group of asArray(asObject(payload).results)) { + for (const match of asArray(asObject(group).results)) { + const tool = asObject(match) as ToolDefinition; + if (tool.name && !found.has(tool.name)) found.set(tool.name, tool); + } + } + return [...found.values()]; +} + +export class CodeOperations { + public constructor(private readonly transport: GatewayTransport) {} + + public async execute(code: string, options: { thought?: string } = {}): Promise { + if (!code.trim()) throw new Error("code is empty"); + return this.transport.callTool(META_CODE, { + code, + ...(options.thought ? { thought: options.thought } : {}), + }); + } +} + +export class Session { + public readonly id: string; + public readonly toolsOperations: ToolsOperations; + public readonly code: CodeOperations; + private readonly transport: GatewayTransport; + + public constructor( + public readonly sessionUrn: string, + public readonly actorId: string, + public readonly name: string, + public readonly policy: Required>, + private readonly mcpURL: string, + private readonly provider: GatewayProvider, + transport: GatewayTransport, + public readonly raw: JsonObject, + public readonly selectedTools: string[], + ) { + this.id = externalSessionId(sessionUrn); + this.transport = transport; + this.toolsOperations = new ToolsOperations(transport, provider); + this.code = new CodeOperations(transport); + } + + public get url(): string { + return this.mcpURL; + } + + public approve(approvalId: string): Promise { + return this.transport.decideApproval(approvalId, "approve"); + } + + public deny(approvalId: string): Promise { + return this.transport.decideApproval(approvalId, "deny"); + } + + public tools(options: SessionToolsOptions = {}): Promise { + return this.toolsOperations.definitions(options); + } + + public async handleToolCalls(response: unknown, options: InvokeOptions = {}): Promise { + const calls = this.provider.extractToolCalls(response); + const results = await this.executeToolCalls(calls, options); + return this.provider.formatToolResults(calls, results); + } + + public async executeToolCalls(calls: ToolCall[], options: InvokeOptions = {}): Promise { + return Promise.all(calls.map(async (call) => { + try { + if (call.name === META_SEARCH) return await this.toolsOperations.search(asArray(call.arguments.queries) as SearchQuery[], call.arguments as SearchOptions); + if (call.name === META_INVOKE) return await this.toolsOperations.invoke(asArray(call.arguments.tools) as InvokeTool[], { + rationale: String(call.arguments.rationale ?? options.rationale ?? "") || undefined, + }); + if (call.name === META_CODE) { + const code = String(call.arguments.code ?? call.arguments.code_to_execute ?? ""); + return await this.code.execute(code, { thought: String(call.arguments.thought ?? "") || undefined }); + } + return await this.toolsOperations.invokeOne(call.name, call.arguments, options); + } catch (error) { + if (error instanceof GatewayError) return toolErrorResult(error); + throw error; + } + })); + } +} + +export class SessionsOperations { + public constructor( + private readonly apiKey: string, + private readonly provider: GatewayProvider, + private readonly sessionsApi: SessionsRequestBuilder, + ) {} + + public async create(options: CreateSessionOptions): Promise { + const actorId = options.actorId?.trim(); + if (!actorId) throw new Error("actorId is required"); + const suffix = Math.random().toString(16).slice(2, 10); + const name = options.name ?? `dots-session-${suffix}`; + const policy = normalizePermissions(options.permissions); + if (options.tools !== undefined && !Array.isArray(options.tools)) { + throw new TypeError("tools must be an array of tool references"); + } + const body: Create_session_request = { + actorId, + name, + policy: toSessionPolicy(policy), + ...(options.tools === undefined ? {} : { tools: options.tools }), + ...(options.config === undefined ? {} : { config: toSessionConfig(options.config) }), + }; + const payload = await this.sessionsApi.post(body); + const raw = asObject(payload?.session); + const sessionUrn = String(payload?.session?.sessionUrn ?? ""); + if (!sessionUrn) throw new GatewayError("session create response is missing sessionUrn", undefined, payload); + const mcpURL = String(payload?.mcpUrl ?? ""); + if (!mcpURL) throw new GatewayError("session create response is missing mcpUrl", undefined, payload); + const selectedTools = (payload?.tools ?? []).map(String); + const transport = new GatewayTransport(this.apiKey, mcpURL, sessionUrn, actorId); + return new Session( + sessionUrn, + actorId, + String(raw.name ?? name), + policy, + mcpURL, + this.provider, + transport, + raw, + selectedTools, + ); + } +} + +export class ActionGatewayClient extends InferenceClient { + public readonly session: SessionsOperations; + public readonly sessions: SessionsOperations; + public readonly sessionsApi: SessionsRequestBuilder; + public readonly tools: ToolsRequestBuilder; + public readonly toolbelts: ToolbeltsRequestBuilder; + public readonly connections: ConnectionsRequestBuilder; + public readonly users: UsersRequestBuilder; + public readonly provider: GatewayProvider; + + public constructor(options: ActionGatewayClientOptions) { + super(options); + const apiKey = options.apiKey?.trim(); + if (!apiKey) throw new Error("apiKey is required"); + const apiBaseURL = normalizeBaseURL(options.apiBaseURL ?? DEFAULT_API_BASE_URL); + this.provider = resolveProvider(options.provider); + + const authProvider = new DigitalOceanApiKeyAuthenticationProvider(apiKey); + const adapter = new FetchRequestAdapter(authProvider); + adapter.baseUrl = apiBaseURL; + const publicApi = createDigitalOceanClient(adapter).v2.actionGateway; + this.sessionsApi = publicApi.sessions; + this.tools = publicApi.tools; + this.toolbelts = publicApi.toolbelts; + this.connections = publicApi.connections; + this.users = publicApi.users; + this.session = new SessionsOperations(apiKey, this.provider, this.sessionsApi); + this.sessions = this.session; + } + + public async createToolbelt(options: CreateToolbeltOptions): Promise { + if (!Array.isArray(options.tools)) throw new TypeError("tools must be an array of tool names"); + const body: Toolbelt_create = { + name: options.name, + tools: options.tools, + version: options.version, + displayName: options.displayName, + description: options.description, + }; + const response = await this.toolbelts.post(body); + const toolbelt = response?.toolbelt; + if (!toolbelt?.reference) throw new GatewayError("toolbelt create response is missing reference"); + return Object.defineProperty(toolbelt, "ref", { + configurable: true, + enumerable: true, + get: () => toolbelt.reference, + }) as ToolbeltWithRef; + } +} + +export { ActionGatewayClient as Client }; +export default ActionGatewayClient; diff --git a/src/dots/kiota-lock.json b/src/dots/kiota-lock.json index 396edcc63..0d6f5efd9 100644 --- a/src/dots/kiota-lock.json +++ b/src/dots/kiota-lock.json @@ -1,8 +1,8 @@ { - "descriptionHash": "CCE903F24E4A8940693F8E9A5FEEFC998596ED47706C2C892ED723F12E81932E1544D0E6CC466F958052B4199BC71D99F51DD1517B625A83BBDA8579A7B3110A", + "descriptionHash": "D1FBECF6FFFEEF309EB5849AD8C9F0C86BABCCF3B6901D07ABE70911FBB0FBC39A9CECD0DEC8EB52FFDE40FCA61259120F72A17F3CC9E89D9DA71A15EBABFE93", "descriptionLocation": "../../DigitalOcean-public.v2.yaml", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.31.1", + "kiotaVersion": "1.34.1", "clientClassName": "DigitalOceanClient", "typeAccessModifier": "Public", "clientNamespaceName": "ApiSdk", @@ -30,5 +30,6 @@ ], "includePatterns": [], "excludePatterns": [], - "disabledValidationRules": [] + "disabledValidationRules": [], + "allowedExternalOrigins": [] } \ No newline at end of file diff --git a/src/dots/models/index.ts b/src/dots/models/index.ts index 10a0d91d2..4c02bec72 100644 --- a/src/dots/models/index.ts +++ b/src/dots/models/index.ts @@ -7372,7 +7372,7 @@ export interface App_event_autoscaling_components extends AdditionalDataHolder, } export type App_event_autoscaling_phase = (typeof App_event_autoscaling_phaseObject)[keyof typeof App_event_autoscaling_phaseObject]; export type App_event_type = (typeof App_event_typeObject)[keyof typeof App_event_typeObject]; -export interface App_events extends Pagination, Parsable { +export interface App_events extends Pages_pagination, Parsable { /** * The events property */ @@ -7719,7 +7719,7 @@ export interface App_job_invocation_trigger_scheduled_schedule extends Additiona timeZone?: string | null; } export type App_job_invocation_trigger_type = (typeof App_job_invocation_trigger_typeObject)[keyof typeof App_job_invocation_trigger_typeObject]; -export interface App_job_invocations extends Pagination, Parsable { +export interface App_job_invocations extends Pages_pagination, Parsable { /** * The job_invocations property */ @@ -9178,6 +9178,54 @@ export interface Async_invoke_response extends AdditionalDataHolder, Parsable { export interface Async_invoke_response_output extends AdditionalDataHolder, Parsable { } export type Async_invoke_response_status = (typeof Async_invoke_response_statusObject)[keyof typeof Async_invoke_response_statusObject]; +export interface Auth_injection extends Parsable { + /** + * The location property + */ + location?: string | null; + /** + * The name property + */ + name?: string | null; + /** + * The scheme property + */ + scheme?: string | null; +} +export interface Auth_spec extends Parsable { + /** + * BaseURLResolution declaratively describes a post-token-exchange lookup anOAuth-backed tool needs to compute its real request base_url (e.g. JiraCloud's per-site cloudId indirection). strategy is a oneof so exactly oneresolution kind can ever be set at a time; "http_lookup" is the only kindimplemented today, see action-executor/internal/credentials for thegeneric resolver that executes this recipe. + */ + baseUrlResolution?: Base_url_resolution | null; + /** + * The credentialBinding property + */ + credentialBinding?: string | null; + /** + * The credentialRefSource property + */ + credentialRefSource?: string | null; + /** + * The doManagedCredentialRef property + */ + doManagedCredentialRef?: string | null; + /** + * The injection property + */ + injection?: Auth_injection | null; + /** + * The modes property + */ + modes?: string[] | null; + /** + * The provider property + */ + provider?: string | null; + /** + * The scopes property + */ + scopes?: string[] | null; +} export interface Autoscale_pool extends AdditionalDataHolder, Parsable { /** * The number of active Droplets in the autoscale pool. @@ -9354,6 +9402,15 @@ export interface Balance extends AdditionalDataHolder, Parsable { */ monthToDateUsage?: string | null; } +/** + * BaseURLResolution declaratively describes a post-token-exchange lookup anOAuth-backed tool needs to compute its real request base_url (e.g. JiraCloud's per-site cloudId indirection). strategy is a oneof so exactly oneresolution kind can ever be set at a time; "http_lookup" is the only kindimplemented today, see action-executor/internal/credentials for thegeneric resolver that executes this recipe. + */ +export interface Base_url_resolution extends Parsable { + /** + * HTTPLookupSpec resolves a base_url by calling url (bearer-authenticatedwith the just-exchanged access token), selecting an entry in the JSON array,extracting extract_field from that entry, and substituting it for "{value}"in base_url_template. When match_field and match_value are both set, theyselect the entry. When both are empty, exactly one entry whose own "scopes"array contains required_scopes must exist. Configuring only one match fieldis invalid. Resolution fails fast on zero or multiple compatible entries. + */ + httpLookup?: Http_lookup_spec | null; +} /** * A Batch Inference job. */ @@ -10271,6 +10328,20 @@ export interface Check_updatable extends AdditionalDataHolder, Parsable { } export type Check_updatable_regions = (typeof Check_updatable_regionsObject)[keyof typeof Check_updatable_regionsObject]; export type Check_updatable_type = (typeof Check_updatable_typeObject)[keyof typeof Check_updatable_typeObject]; +export interface Classification extends Parsable { + /** + * The dataClasses property + */ + dataClasses?: string[] | null; + /** + * The operation property + */ + operation?: string | null; + /** + * The risk property + */ + risk?: string | null; +} export interface Cluster extends AdditionalDataHolder, Parsable { /** * An object specifying whether the AMD Device Metrics Exporter should be enabled in the Kubernetes cluster. @@ -10760,6 +10831,68 @@ export interface Completion_usage_cache_creation extends AdditionalDataHolder, P */ ephemeral5mInputTokens?: number | null; } +/** + * ConnectionAuthorization is present only while a connection is pending. TheUI sends the user to connect_url and polls GetConnection until the connectionbecomes active or expires. The Secrets Manager poll URL is never exposed. + */ +export interface Connection_authorization extends Parsable { + /** + * The connect_url property + */ + connectUrl?: string | null; + /** + * The expires_at property + */ + expiresAt?: Date | null; + /** + * The status property + */ + status?: string | null; + /** + * The verification_code property + */ + verificationCode?: string | null; +} +/** + * ConnectionParameterSpec describes one non-sensitive value collected whileconfiguring a provider connection. The UI and MCP clients render thesespecifications generically. + */ +export interface Connection_parameter_spec extends Parsable { + /** + * The allowed_host_suffixes property + */ + allowedHostSuffixes?: string[] | null; + /** + * The allowed_values property + */ + allowedValues?: string[] | null; + /** + * The description property + */ + description?: string | null; + /** + * The input_kind property + */ + inputKind?: string | null; + /** + * The key property + */ + key?: string | null; + /** + * The label property + */ + label?: string | null; + /** + * The max_length property + */ + maxLength?: number | null; + /** + * The normalization property + */ + normalization?: string | null; + /** + * The required property + */ + required?: boolean | null; +} export interface Connection_pool extends AdditionalDataHolder, Parsable { /** * The connection property @@ -10844,6 +10977,36 @@ export interface Coredns_autoscaler extends AdditionalDataHolder, Parsable { */ enabled?: boolean | null; } +export interface Create_connection_request extends Parsable { + /** + * The connection_parameters property + */ + connectionParameters?: Create_connection_request_connection_parameters | null; + /** + * The provider property + */ + provider?: string | null; + /** + * The scopes property + */ + scopes?: string[] | null; + /** + * The user_id property + */ + userId?: string | null; +} +export interface Create_connection_request_connection_parameters extends AdditionalDataHolder, Parsable { +} +export interface Create_connection_response extends Parsable { + /** + * ConnectionAuthorization is present only while a connection is pending. TheUI sends the user to connect_url and polls GetConnection until the connectionbecomes active or expires. The Secrets Manager poll URL is never exposed. + */ + authorization?: Connection_authorization | null; + /** + * -----------------------------------------------------------------------------OAuth connection resources-----------------------------------------------------------------------------OAuthConnection is the public, team-scoped connection metadata returned tothe UI. It deliberately excludes the team ID, Secrets Manager assignment,actor identifiers, poll URL, and authorization handle. + */ + connection?: Oauth_connection | null; +} /** * Request body for image generation. */ @@ -11183,6 +11346,51 @@ export interface Create_team_request extends AdditionalDataHolder, Parsable { */ name?: string | null; } +export interface Create_session_request extends Parsable { + /** + * The actor_id property + */ + actorId?: string | null; + /** + * Opaque session options. config.preloadTools may contain concrete toolnames (optionally version-pinned) and version-pinned toolbelt references. + */ + config?: Create_session_request_config | null; + /** + * The name property + */ + name?: string | null; + /** + * Invocation policy. Omit to use a default action of ask. + */ + policy?: Session_policy_spec | null; + /** + * Omitted enables every tool. An explicit empty array enables no tools.Direct tools may be or @; toolbelt references mustbe version-pinned as toolbelt:@. + */ + tools?: string[] | null; +} +/** + * Opaque session options. config.preloadTools may contain concrete toolnames (optionally version-pinned) and version-pinned toolbelt references. + */ +export interface Create_session_request_config extends AdditionalDataHolder, Parsable { + /** + * Concrete tools or pinned toolbelts to expose directly beside the session meta-tools. + */ + preloadTools?: string[] | null; +} +export interface Create_session_response extends Parsable { + /** + * Public session-pinned MCP URL. + */ + mcpUrl?: string | null; + /** + * A session and the tool-permission policy bound to it. + */ + session?: Public_session_policy | null; + /** + * Canonical, version-pinned selected tool references. + */ + tools?: string[] | null; +} export interface Create_trigger extends AdditionalDataHolder, Parsable { /** * Name of function(action) that exists in the given namespace. @@ -15255,6 +15463,24 @@ export function createAsync_invoke_response_outputFromDiscriminatorValue(parseNo export function createAsync_invoke_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoAsync_invoke_response; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Auth_injection} + */ +// @ts-ignore +export function createAuth_injectionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoAuth_injection; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Auth_spec} + */ +// @ts-ignore +export function createAuth_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoAuth_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -15345,6 +15571,15 @@ export function createBackward_linksFromDiscriminatorValue(parseNode: ParseNode export function createBalanceFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoBalance; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Base_url_resolution} + */ +// @ts-ignore +export function createBase_url_resolutionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoBase_url_resolution; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -15759,6 +15994,15 @@ export function createCheck_updatableFromDiscriminatorValue(parseNode: ParseNode export function createCheckFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoCheck; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Classification} + */ +// @ts-ignore +export function createClassificationFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoClassification; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -15885,6 +16129,24 @@ export function createCompletion_usage_cache_creationFromDiscriminatorValue(pars export function createCompletion_usageFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoCompletion_usage; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Connection_authorization} + */ +// @ts-ignore +export function createConnection_authorizationFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoConnection_authorization; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Connection_parameter_spec} + */ +// @ts-ignore +export function createConnection_parameter_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoConnection_parameter_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -15930,6 +16192,33 @@ export function createControl_plane_firewallFromDiscriminatorValue(parseNode: Pa export function createCoredns_autoscalerFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoCoredns_autoscaler; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Create_connection_request_connection_parameters} + */ +// @ts-ignore +export function createCreate_connection_request_connection_parametersFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoCreate_connection_request_connection_parameters; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Create_connection_request} + */ +// @ts-ignore +export function createCreate_connection_requestFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoCreate_connection_request; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Create_connection_response} + */ +// @ts-ignore +export function createCreate_connection_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoCreate_connection_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -16110,6 +16399,33 @@ export function createCreate_team_requestFromDiscriminatorValue(parseNode: Parse export function createCreate_teamFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoCreate_team; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Create_session_request_config} + */ +// @ts-ignore +export function createCreate_session_request_configFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoCreate_session_request_config; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Create_session_request} + */ +// @ts-ignore +export function createCreate_session_requestFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoCreate_session_request; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Create_session_response} + */ +// @ts-ignore +export function createCreate_session_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoCreate_session_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -16497,6 +16813,24 @@ export function createDedicated_inference_update_requestFromDiscriminatorValue(p export function createDedicated_inferenceFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoDedicated_inference; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Delete_connection_response} + */ +// @ts-ignore +export function createDelete_connection_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoDelete_connection_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Delete_session_response} + */ +// @ts-ignore +export function createDelete_session_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoDelete_session_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -16974,6 +17308,15 @@ export function createErrorEscapedFromDiscriminatorValue(parseNode: ParseNode | export function createEvents_logsFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoEvents_logs; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Execution_spec} + */ +// @ts-ignore +export function createExecution_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoExecution_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -17176,6 +17519,24 @@ export function createGenaiapiRegionFromDiscriminatorValue(parseNode: ParseNode export function createGenerated_imageFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoGenerated_image; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Get_connection_response} + */ +// @ts-ignore +export function createGet_connection_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoGet_connection_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Get_user_response} + */ +// @ts-ignore +export function createGet_user_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoGet_user_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -17248,6 +17609,33 @@ export function createHealth_checkFromDiscriminatorValue(parseNode: ParseNode | export function createHistoryFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoHistory; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Hook_spec} + */ +// @ts-ignore +export function createHook_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoHook_spec; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Http_execution} + */ +// @ts-ignore +export function createHttp_executionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoHttp_execution; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Http_lookup_spec} + */ +// @ts-ignore +export function createHttp_lookup_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoHttp_lookup_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -17617,6 +18005,15 @@ export function createKubernetes_versionFromDiscriminatorValue(parseNode: ParseN export function createLb_firewallFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoLb_firewall; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {List_connections_response} + */ +// @ts-ignore +export function createList_connections_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoList_connections_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -17626,6 +18023,51 @@ export function createLb_firewallFromDiscriminatorValue(parseNode: ParseNode | u export function createList_models_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoList_models_response; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {List_providers_response} + */ +// @ts-ignore +export function createList_providers_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoList_providers_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {List_sessions_response} + */ +// @ts-ignore +export function createList_sessions_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoList_sessions_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {List_toolkits_response} + */ +// @ts-ignore +export function createList_toolkits_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoList_toolkits_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {List_tools_response} + */ +// @ts-ignore +export function createList_tools_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoList_tools_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {List_users_response} + */ +// @ts-ignore +export function createList_users_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoList_users_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -17743,6 +18185,15 @@ export function createLogsink_verboseFromDiscriminatorValue(parseNode: ParseNode export function createMaintenance_policyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoMaintenance_policy; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Mcp_execution} + */ +// @ts-ignore +export function createMcp_executionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoMcp_execution; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -18364,6 +18815,24 @@ export function createNotificationFromDiscriminatorValue(parseNode: ParseNode | export function createNvidia_gpu_device_pluginFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoNvidia_gpu_device_plugin; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Oauth_connection_connection_parameters} + */ +// @ts-ignore +export function createOauth_connection_connection_parametersFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoOauth_connection_connection_parameters; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Oauth_connection} + */ +// @ts-ignore +export function createOauth_connectionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoOauth_connection; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -18634,6 +19103,15 @@ export function createPage_links_pagesMember1FromDiscriminatorValue(parseNode: P export function createPage_linksFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoPage_links; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Pages_pagination} + */ +// @ts-ignore +export function createPages_paginationFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoPages_pagination; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -18751,6 +19229,15 @@ export function createPending_deployment_specFromDiscriminatorValue(parseNode: P export function createPgbouncer_advanced_configFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoPgbouncer_advanced_config; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Policy_spec} + */ +// @ts-ignore +export function createPolicy_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoPolicy_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -18814,6 +19301,33 @@ export function createProject_baseFromDiscriminatorValue(parseNode: ParseNode | export function createProjectFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoProject; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Provider_summary} + */ +// @ts-ignore +export function createProvider_summaryFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoProvider_summary; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Public_session_policy_config} + */ +// @ts-ignore +export function createPublic_session_policy_configFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoPublic_session_policy_config; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Public_session_policy} + */ +// @ts-ignore +export function createPublic_session_policyFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoPublic_session_policy; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -18904,6 +19418,15 @@ export function createRegistry_run_gcFromDiscriminatorValue(parseNode: ParseNode export function createRegistryFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoRegistry; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Reliability_spec} + */ +// @ts-ignore +export function createReliability_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoReliability_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -19119,6 +19642,15 @@ export function createResponse_usage_output_tokens_detailsFromDiscriminatorValue export function createResponse_usageFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoResponse_usage; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Retry_spec} + */ +// @ts-ignore +export function createRetry_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoRetry_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -19200,6 +19732,51 @@ export function createSchema_registry_connectionFromDiscriminatorValue(parseNode export function createSelective_destroy_associated_resourceFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoSelective_destroy_associated_resource; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Session_policy_rule_match} + */ +// @ts-ignore +export function createSession_policy_rule_matchFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoSession_policy_rule_match; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Session_policy_rule} + */ +// @ts-ignore +export function createSession_policy_ruleFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoSession_policy_rule; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Session_policy_spec} + */ +// @ts-ignore +export function createSession_policy_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoSession_policy_spec; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Session_tool_reference} + */ +// @ts-ignore +export function createSession_tool_referenceFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoSession_tool_reference; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Session_tool_selection} + */ +// @ts-ignore +export function createSession_tool_selectionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoSession_tool_selection; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -19506,6 +20083,159 @@ export function createTeam_invitationFromDiscriminatorValue(parseNode: ParseNode export function createTimescaledb_advanced_configFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoTimescaledb_advanced_config; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool_annotations} + */ +// @ts-ignore +export function createTool_annotationsFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool_annotations; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool_definition_inputSchema} + */ +// @ts-ignore +export function createTool_definition_inputSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool_definition_inputSchema; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool_definition_outputSchema} + */ +// @ts-ignore +export function createTool_definition_outputSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool_definition_outputSchema; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool_definition} + */ +// @ts-ignore +export function createTool_definitionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool_definition; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool_inputSchema} + */ +// @ts-ignore +export function createTool_inputSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool_inputSchema; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool_outputSchema} + */ +// @ts-ignore +export function createTool_outputSchemaFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool_outputSchema; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolbelt_create} + */ +// @ts-ignore +export function createToolbelt_createFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolbelt_create; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolbelt_response} + */ +// @ts-ignore +export function createToolbelt_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolbelt_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolbelt_summary} + */ +// @ts-ignore +export function createToolbelt_summaryFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolbelt_summary; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolbelt_tools} + */ +// @ts-ignore +export function createToolbelt_toolsFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolbelt_tools; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolbelt} + */ +// @ts-ignore +export function createToolbeltFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolbelt; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolbelts_response} + */ +// @ts-ignore +export function createToolbelts_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolbelts_response; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Tool} + */ +// @ts-ignore +export function createToolFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTool; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Toolkit} + */ +// @ts-ignore +export function createToolkitFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoToolkit; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Transform_spec_input} + */ +// @ts-ignore +export function createTransform_spec_inputFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTransform_spec_input; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Transform_spec_output} + */ +// @ts-ignore +export function createTransform_spec_outputFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTransform_spec_output; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Transform_spec} + */ +// @ts-ignore +export function createTransform_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoTransform_spec; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -19524,6 +20254,33 @@ export function createTrigger_info_scheduled_runsFromDiscriminatorValue(parseNod export function createTrigger_infoFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoTrigger_info; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Update_connection_parameters_request_connection_parameters} + */ +// @ts-ignore +export function createUpdate_connection_parameters_request_connection_parametersFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUpdate_connection_parameters_request_connection_parameters; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Update_connection_parameters_request} + */ +// @ts-ignore +export function createUpdate_connection_parameters_requestFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUpdate_connection_parameters_request; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Update_connection_parameters_response} + */ +// @ts-ignore +export function createUpdate_connection_parameters_responseFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUpdate_connection_parameters_response; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -19554,11 +20311,29 @@ export function createUpdate_triggerFromDiscriminatorValue(parseNode: ParseNode /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object - * @returns {User_kubernetes_cluster_user} + * @returns {Usage_meter} */ // @ts-ignore -export function createUser_kubernetes_cluster_userFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { - return deserializeIntoUser_kubernetes_cluster_user; +export function createUsage_meterFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUsage_meter; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {Usage_spec} + */ +// @ts-ignore +export function createUsage_specFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUsage_spec; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {User_session} + */ +// @ts-ignore +export function createUser_sessionFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUser_session; } /** * Creates a new instance of the appropriate class based on discriminator value @@ -19596,6 +20371,24 @@ export function createUser_settings_opensearch_aclFromDiscriminatorValue(parseNo export function createUser_settingsFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { return deserializeIntoUser_settings; } +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {User2_kubernetes_cluster_user} + */ +// @ts-ignore +export function createUser2_kubernetes_cluster_userFromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUser2_kubernetes_cluster_user; +} +/** + * Creates a new instance of the appropriate class based on discriminator value + * @param parseNode The parse node to use to read the discriminator value and create the object + * @returns {User2} + */ +// @ts-ignore +export function createUser2FromDiscriminatorValue(parseNode: ParseNode | undefined) : ((instance?: Parsable) => Record void>) { + return deserializeIntoUser2; +} /** * Creates a new instance of the appropriate class based on discriminator value * @param parseNode The parse node to use to read the discriminator value and create the object @@ -20918,6 +21711,14 @@ export interface Dedicated_inference_update_request_access_tokens extends Parsab */ huggingFaceToken?: string | null; } +export interface Delete_connection_response extends Parsable { + /** + * -----------------------------------------------------------------------------OAuth connection resources-----------------------------------------------------------------------------OAuthConnection is the public, team-scoped connection metadata returned tothe UI. It deliberately excludes the team ID, Secrets Manager assignment,actor identifiers, poll URL, and authorization handle. + */ + connection?: Oauth_connection | null; +} +export interface Delete_session_response extends Parsable { +} /** * The deserialization information for the current model * @param Accelerator_config_spec The instance to deserialize into. @@ -25856,7 +26657,7 @@ export function deserializeIntoApp_event_autoscaling_components(app_event_autosc // @ts-ignore export function deserializeIntoApp_events(app_events: Partial | undefined = {}) : Record void> { return { - ...deserializeIntoPagination(app_events), + ...deserializeIntoPages_pagination(app_events), "events": n => { app_events.events = n.getCollectionOfObjectValues(createApp_eventFromDiscriminatorValue); }, } } @@ -26145,7 +26946,7 @@ export function deserializeIntoApp_job_invocation_trigger_scheduled_schedule(app // @ts-ignore export function deserializeIntoApp_job_invocations(app_job_invocations: Partial | undefined = {}) : Record void> { return { - ...deserializeIntoPagination(app_job_invocations), + ...deserializeIntoPages_pagination(app_job_invocations), "job_invocations": n => { app_job_invocations.jobInvocations = n.getCollectionOfObjectValues(createApp_job_invocationFromDiscriminatorValue); }, } } @@ -27237,6 +28038,37 @@ export function deserializeIntoAsync_invoke_response_output(async_invoke_respons return { } } +/** + * The deserialization information for the current model + * @param Auth_injection The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoAuth_injection(auth_injection: Partial | undefined = {}) : Record void> { + return { + "location": n => { auth_injection.location = n.getStringValue(); }, + "name": n => { auth_injection.name = n.getStringValue(); }, + "scheme": n => { auth_injection.scheme = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Auth_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoAuth_spec(auth_spec: Partial | undefined = {}) : Record void> { + return { + "baseUrlResolution": n => { auth_spec.baseUrlResolution = n.getObjectValue(createBase_url_resolutionFromDiscriminatorValue); }, + "credentialBinding": n => { auth_spec.credentialBinding = n.getStringValue(); }, + "credentialRefSource": n => { auth_spec.credentialRefSource = n.getStringValue(); }, + "doManagedCredentialRef": n => { auth_spec.doManagedCredentialRef = n.getStringValue(); }, + "injection": n => { auth_spec.injection = n.getObjectValue(createAuth_injectionFromDiscriminatorValue); }, + "modes": n => { auth_spec.modes = n.getCollectionOfPrimitiveValues(); }, + "provider": n => { auth_spec.provider = n.getStringValue(); }, + "scopes": n => { auth_spec.scopes = n.getCollectionOfPrimitiveValues(); }, + } +} /** * The deserialization information for the current model * @param Autoscale_pool The instance to deserialize into. @@ -27380,6 +28212,17 @@ export function deserializeIntoBalance(balance: Partial | undefined = { "month_to_date_usage": n => { balance.monthToDateUsage = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Base_url_resolution The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoBase_url_resolution(base_url_resolution: Partial | undefined = {}) : Record void> { + return { + "httpLookup": n => { base_url_resolution.httpLookup = n.getObjectValue(createHttp_lookup_specFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param Batch The instance to deserialize into. @@ -28033,6 +28876,19 @@ export function deserializeIntoCheck_updatable(check_updatable: Partial { check_updatable.type = n.getEnumValue(Check_updatable_typeObject); }, } } +/** + * The deserialization information for the current model + * @param Classification The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoClassification(classification: Partial | undefined = {}) : Record void> { + return { + "dataClasses": n => { classification.dataClasses = n.getCollectionOfPrimitiveValues(); }, + "operation": n => { classification.operation = n.getStringValue(); }, + "risk": n => { classification.risk = n.getStringValue(); }, + } +} /** * The deserialization information for the current model * @param Cluster The instance to deserialize into. @@ -28283,6 +29139,39 @@ export function deserializeIntoCompletion_usage_cache_creation(completion_usage_ "ephemeral_5m_input_tokens": n => { completion_usage_cache_creation.ephemeral5mInputTokens = n.getNumberValue(); }, } } +/** + * The deserialization information for the current model + * @param Connection_authorization The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoConnection_authorization(connection_authorization: Partial | undefined = {}) : Record void> { + return { + "connect_url": n => { connection_authorization.connectUrl = n.getStringValue(); }, + "expires_at": n => { connection_authorization.expiresAt = n.getDateValue(); }, + "status": n => { connection_authorization.status = n.getStringValue(); }, + "verification_code": n => { connection_authorization.verificationCode = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Connection_parameter_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoConnection_parameter_spec(connection_parameter_spec: Partial | undefined = {}) : Record void> { + return { + "allowed_host_suffixes": n => { connection_parameter_spec.allowedHostSuffixes = n.getCollectionOfPrimitiveValues(); }, + "allowed_values": n => { connection_parameter_spec.allowedValues = n.getCollectionOfPrimitiveValues(); }, + "description": n => { connection_parameter_spec.description = n.getStringValue(); }, + "input_kind": n => { connection_parameter_spec.inputKind = n.getStringValue(); }, + "key": n => { connection_parameter_spec.key = n.getStringValue(); }, + "label": n => { connection_parameter_spec.label = n.getStringValue(); }, + "max_length": n => { connection_parameter_spec.maxLength = n.getNumberValue(); }, + "normalization": n => { connection_parameter_spec.normalization = n.getStringValue(); }, + "required": n => { connection_parameter_spec.required = n.getBooleanValue(); }, + } +} /** * The deserialization information for the current model * @param Connection_pool The instance to deserialize into. @@ -28350,6 +29239,42 @@ export function deserializeIntoCoredns_autoscaler(coredns_autoscaler: Partial { coredns_autoscaler.enabled = n.getBooleanValue(); }, } } +/** + * The deserialization information for the current model + * @param Create_connection_request The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoCreate_connection_request(create_connection_request: Partial | undefined = {}) : Record void> { + return { + "connection_parameters": n => { create_connection_request.connectionParameters = n.getObjectValue(createCreate_connection_request_connection_parametersFromDiscriminatorValue); }, + "provider": n => { create_connection_request.provider = n.getStringValue(); }, + "scopes": n => { create_connection_request.scopes = n.getCollectionOfPrimitiveValues(); }, + "user_id": n => { create_connection_request.userId = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Create_connection_request_connection_parameters The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoCreate_connection_request_connection_parameters(create_connection_request_connection_parameters: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Create_connection_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoCreate_connection_response(create_connection_response: Partial | undefined = {}) : Record void> { + return { + "authorization": n => { create_connection_response.authorization = n.getObjectValue(createConnection_authorizationFromDiscriminatorValue); }, + "connection": n => { create_connection_response.connection = n.getObjectValue(createOauth_connectionFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param Create_image_request The instance to deserialize into. @@ -28622,6 +29547,45 @@ export function deserializeIntoCreate_team_request(create_team_request: Partial< "name": n => { create_team_request.name = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Create_session_request The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoCreate_session_request(create_session_request: Partial | undefined = {}) : Record void> { + return { + "actor_id": n => { create_session_request.actorId = n.getStringValue(); }, + "config": n => { create_session_request.config = n.getObjectValue(createCreate_session_request_configFromDiscriminatorValue); }, + "name": n => { create_session_request.name = n.getStringValue(); }, + "policy": n => { create_session_request.policy = n.getObjectValue(createSession_policy_specFromDiscriminatorValue); }, + "tools": n => { create_session_request.tools = n.getCollectionOfPrimitiveValues(); }, + } +} +/** + * The deserialization information for the current model + * @param Create_session_request_config The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoCreate_session_request_config(create_session_request_config: Partial | undefined = {}) : Record void> { + return { + "preloadTools": n => { create_session_request_config.preloadTools = n.getCollectionOfPrimitiveValues(); }, + } +} +/** + * The deserialization information for the current model + * @param Create_session_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoCreate_session_response(create_session_response: Partial | undefined = {}) : Record void> { + return { + "mcpUrl": n => { create_session_response.mcpUrl = n.getStringValue(); }, + "session": n => { create_session_response.session = n.getObjectValue(createPublic_session_policyFromDiscriminatorValue); }, + "tools": n => { create_session_response.tools = n.getCollectionOfPrimitiveValues(); }, + } +} /** * The deserialization information for the current model * @param Create_trigger The instance to deserialize into. @@ -29260,6 +30224,27 @@ export function deserializeIntoDedicated_inference_update_request_access_tokens( "hugging_face_token": n => { dedicated_inference_update_request_access_tokens.huggingFaceToken = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Delete_connection_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoDelete_connection_response(delete_connection_response: Partial | undefined = {}) : Record void> { + return { + "connection": n => { delete_connection_response.connection = n.getObjectValue(createOauth_connectionFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Delete_session_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoDelete_session_response(delete_session_response: Partial | undefined = {}) : Record void> { + return { + } +} /** * The deserialization information for the current model * @param Destination The instance to deserialize into. @@ -29928,6 +30913,21 @@ export function deserializeIntoEvents_logs(events_logs: Partial | u "id": n => { events_logs.id = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Execution_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoExecution_spec(execution_spec: Partial | undefined = {}) : Record void> { + return { + "adapterVersion": n => { execution_spec.adapterVersion = n.getStringValue(); }, + "configRef": n => { execution_spec.configRef = n.getStringValue(); }, + "http": n => { execution_spec.http = n.getObjectValue(createHttp_executionFromDiscriminatorValue); }, + "mcp": n => { execution_spec.mcp = n.getObjectValue(createMcp_executionFromDiscriminatorValue); }, + "type": n => { execution_spec.type = n.getStringValue(); }, + } +} /** * The deserialization information for the current model * @param Firewall The instance to deserialize into. @@ -30205,6 +31205,29 @@ export function deserializeIntoGenerated_image(generated_image: Partial { generated_image.revisedPrompt = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Get_connection_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoGet_connection_response(get_connection_response: Partial | undefined = {}) : Record void> { + return { + "authorization": n => { get_connection_response.authorization = n.getObjectValue(createConnection_authorizationFromDiscriminatorValue); }, + "connection": n => { get_connection_response.connection = n.getObjectValue(createOauth_connectionFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Get_user_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoGet_user_response(get_user_response: Partial | undefined = {}) : Record void> { + return { + "user": n => { get_user_response.user = n.getObjectValue(createUserFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param Glb_settings The instance to deserialize into. @@ -30312,6 +31335,53 @@ export function deserializeIntoHistory(history: Partial | undefined = { "updated_at": n => { history.updatedAt = n.getDateValue(); }, } } +/** + * The deserialization information for the current model + * @param Hook_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoHook_spec(hook_spec: Partial | undefined = {}) : Record void> { + return { + "usage": n => { hook_spec.usage = n.getObjectValue(createUsage_specFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Http_execution The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoHttp_execution(http_execution: Partial | undefined = {}) : Record void> { + return { + "allowedHosts": n => { http_execution.allowedHosts = n.getCollectionOfPrimitiveValues(); }, + "baseUrl": n => { http_execution.baseUrl = n.getStringValue(); }, + "method": n => { http_execution.method = n.getStringValue(); }, + "path": n => { http_execution.path = n.getStringValue(); }, + "requestEncoding": n => { http_execution.requestEncoding = n.getStringValue(); }, + "responseFormat": n => { http_execution.responseFormat = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Http_lookup_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoHttp_lookup_spec(http_lookup_spec: Partial | undefined = {}) : Record void> { + return { + "baseUrlTemplate": n => { http_lookup_spec.baseUrlTemplate = n.getStringValue(); }, + "caseInsensitive": n => { http_lookup_spec.caseInsensitive = n.getBooleanValue(); }, + "extractField": n => { http_lookup_spec.extractField = n.getStringValue(); }, + "matchField": n => { http_lookup_spec.matchField = n.getStringValue(); }, + "matchValue": n => { http_lookup_spec.matchValue = n.getStringValue(); }, + "match_value_parameter": n => { http_lookup_spec.matchValueParameter = n.getStringValue(); }, + "method": n => { http_lookup_spec.method = n.getStringValue(); }, + "requiredScopes": n => { http_lookup_spec.requiredScopes = n.getCollectionOfPrimitiveValues(); }, + "trimTrailingSlash": n => { http_lookup_spec.trimTrailingSlash = n.getBooleanValue(); }, + "url": n => { http_lookup_spec.url = n.getStringValue(); }, + } +} /** * The deserialization information for the current model * @param Image The instance to deserialize into. @@ -30931,6 +32001,18 @@ export function deserializeIntoLb_firewall(lb_firewall: Partial | u "deny": n => { lb_firewall.deny = n.getCollectionOfPrimitiveValues(); }, } } +/** + * The deserialization information for the current model + * @param List_connections_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoList_connections_response(list_connections_response: Partial | undefined = {}) : Record void> { + return { + "connections": n => { list_connections_response.connections = n.getCollectionOfObjectValues(createOauth_connectionFromDiscriminatorValue); }, + "pagination": n => { list_connections_response.pagination = n.getObjectValue(createPaginationFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param List_models_response The instance to deserialize into. @@ -30943,6 +32025,67 @@ export function deserializeIntoList_models_response(list_models_response: Partia "object": n => { list_models_response.object = n.getEnumValue(List_models_response_objectObject); }, } } +/** + * The deserialization information for the current model + * @param List_providers_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoList_providers_response(list_providers_response: Partial | undefined = {}) : Record void> { + return { + "providers": n => { list_providers_response.providers = n.getCollectionOfObjectValues(createProvider_summaryFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param List_sessions_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoList_sessions_response(list_sessions_response: Partial | undefined = {}) : Record void> { + return { + "pagination": n => { list_sessions_response.pagination = n.getObjectValue(createPaginationFromDiscriminatorValue); }, + "sessions": n => { list_sessions_response.sessions = n.getCollectionOfObjectValues(createPublic_session_policyFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param List_toolkits_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoList_toolkits_response(list_toolkits_response: Partial | undefined = {}) : Record void> { + return { + "toolkits": n => { list_toolkits_response.toolkits = n.getCollectionOfObjectValues(createToolkitFromDiscriminatorValue); }, + "version": n => { list_toolkits_response.version = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param List_tools_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoList_tools_response(list_tools_response: Partial | undefined = {}) : Record void> { + return { + "definitions": n => { list_tools_response.definitions = n.getCollectionOfObjectValues(createTool_definitionFromDiscriminatorValue); }, + "pagination": n => { list_tools_response.pagination = n.getObjectValue(createPaginationFromDiscriminatorValue); }, + "tools": n => { list_tools_response.tools = n.getCollectionOfObjectValues(createToolFromDiscriminatorValue); }, + "version": n => { list_tools_response.version = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param List_users_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoList_users_response(list_users_response: Partial | undefined = {}) : Record void> { + return { + "pagination": n => { list_users_response.pagination = n.getObjectValue(createPaginationFromDiscriminatorValue); }, + "user_ids": n => { list_users_response.userIds = n.getCollectionOfPrimitiveValues(); }, + } +} /** * The deserialization information for the current model * @param Load_balancer The instance to deserialize into. @@ -31131,6 +32274,21 @@ export function deserializeIntoMaintenance_policy(maintenance_policy: Partial { maintenance_policy.startTime = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Mcp_execution The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoMcp_execution(mcp_execution: Partial | undefined = {}) : Record void> { + return { + "allowedHosts": n => { mcp_execution.allowedHosts = n.getCollectionOfPrimitiveValues(); }, + "endpoint": n => { mcp_execution.endpoint = n.getStringValue(); }, + "serverRef": n => { mcp_execution.serverRef = n.getStringValue(); }, + "toolName": n => { mcp_execution.toolName = n.getStringValue(); }, + "transport": n => { mcp_execution.transport = n.getStringValue(); }, + } +} /** * The deserialization information for the current model * @param Member The instance to deserialize into. @@ -32052,6 +33210,37 @@ export function deserializeIntoNvidia_gpu_device_plugin(nvidia_gpu_device_plugin "enabled": n => { nvidia_gpu_device_plugin.enabled = n.getBooleanValue(); }, } } +/** + * The deserialization information for the current model + * @param Oauth_connection The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoOauth_connection(oauth_connection: Partial | undefined = {}) : Record void> { + return { + "connection_parameters": n => { oauth_connection.connectionParameters = n.getObjectValue(createOauth_connection_connection_parametersFromDiscriminatorValue); }, + "created_at": n => { oauth_connection.createdAt = n.getDateValue(); }, + "granted_at": n => { oauth_connection.grantedAt = n.getDateValue(); }, + "id": n => { oauth_connection.id = n.getStringValue(); }, + "provider": n => { oauth_connection.provider = n.getStringValue(); }, + "provider_display_name": n => { oauth_connection.providerDisplayName = n.getStringValue(); }, + "revoked_at": n => { oauth_connection.revokedAt = n.getDateValue(); }, + "scopes": n => { oauth_connection.scopes = n.getCollectionOfPrimitiveValues(); }, + "status": n => { oauth_connection.status = n.getStringValue(); }, + "updated_at": n => { oauth_connection.updatedAt = n.getDateValue(); }, + "user_id": n => { oauth_connection.userId = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Oauth_connection_connection_parameters The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoOauth_connection_connection_parameters(oauth_connection_connection_parameters: Partial | undefined = {}) : Record void> { + return { + } +} /** * The deserialization information for the current model * @param OneClicks The instance to deserialize into. @@ -32502,6 +33691,17 @@ export function deserializeIntoPage_links_pagesMember1(page_links_pagesMember1: return { } } +/** + * The deserialization information for the current model + * @param Pages_pagination The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoPages_pagination(pages_pagination: Partial | undefined = {}) : Record void> { + return { + "links": n => { pages_pagination.links = n.getObjectValue(createPage_linksFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param Pagination The instance to deserialize into. @@ -32510,7 +33710,9 @@ export function deserializeIntoPage_links_pagesMember1(page_links_pagesMember1: // @ts-ignore export function deserializeIntoPagination(pagination: Partial | undefined = {}) : Record void> { return { - "links": n => { pagination.links = n.getObjectValue(createPage_linksFromDiscriminatorValue); }, + "page": n => { pagination.page = n.getNumberValue(); }, + "per_page": n => { pagination.perPage = n.getNumberValue(); }, + "total": n => { pagination.total = n.getNumberValue(); }, } } /** @@ -32687,6 +33889,17 @@ export function deserializeIntoPgbouncer_advanced_config(pgbouncer_advanced_conf "server_reset_query_always": n => { pgbouncer_advanced_config.serverResetQueryAlways = n.getBooleanValue(); }, } } +/** + * The deserialization information for the current model + * @param Policy_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoPolicy_spec(policy_spec: Partial | undefined = {}) : Record void> { + return { + "permission": n => { policy_spec.permission = n.getStringValue(); }, + } +} /** * The deserialization information for the current model * @param Postgres_advanced_config The instance to deserialize into. @@ -32835,6 +34048,50 @@ export function deserializeIntoProject_base(project_base: Partial "updated_at": n => { project_base.updatedAt = n.getDateValue(); }, } } +/** + * The deserialization information for the current model + * @param Provider_summary The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoProvider_summary(provider_summary: Partial | undefined = {}) : Record void> { + return { + "auth_type": n => { provider_summary.authType = n.getStringValue(); }, + "connection_parameters": n => { provider_summary.connectionParameters = n.getCollectionOfObjectValues(createConnection_parameter_specFromDiscriminatorValue); }, + "description": n => { provider_summary.description = n.getStringValue(); }, + "display_name": n => { provider_summary.displayName = n.getStringValue(); }, + "name": n => { provider_summary.name = n.getStringValue(); }, + "scopes": n => { provider_summary.scopes = n.getCollectionOfPrimitiveValues(); }, + } +} +/** + * The deserialization information for the current model + * @param Public_session_policy The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoPublic_session_policy(public_session_policy: Partial | undefined = {}) : Record void> { + return { + "actorId": n => { public_session_policy.actorId = n.getStringValue(); }, + "config": n => { public_session_policy.config = n.getObjectValue(createPublic_session_policy_configFromDiscriminatorValue); }, + "createdAt": n => { public_session_policy.createdAt = n.getDateValue(); }, + "name": n => { public_session_policy.name = n.getStringValue(); }, + "policy": n => { public_session_policy.policy = n.getObjectValue(createSession_policy_specFromDiscriminatorValue); }, + "sessionUrn": n => { public_session_policy.sessionUrn = n.getStringValue(); }, + "tools": n => { public_session_policy.tools = n.getObjectValue(createSession_tool_selectionFromDiscriminatorValue); }, + "updatedAt": n => { public_session_policy.updatedAt = n.getDateValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Public_session_policy_config The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoPublic_session_policy_config(public_session_policy_config: Partial | undefined = {}) : Record void> { + return { + } +} /** * The deserialization information for the current model * @param Purge_cache The instance to deserialize into. @@ -32969,6 +34226,19 @@ export function deserializeIntoRegistry_run_gc(registry_run_gc: Partial { registry_run_gc.type = n.getEnumValue(Registry_run_gc_typeObject); }, } } +/** + * The deserialization information for the current model + * @param Reliability_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoReliability_spec(reliability_spec: Partial | undefined = {}) : Record void> { + return { + "maxOutputBytes": n => { reliability_spec.maxOutputBytes = n.getStringValue(); }, + "retry": n => { reliability_spec.retry = n.getObjectValue(createRetry_specFromDiscriminatorValue); }, + "timeoutMs": n => { reliability_spec.timeoutMs = n.getNumberValue(); }, + } +} /** * The deserialization information for the current model * @param Repository The instance to deserialize into. @@ -33239,6 +34509,19 @@ export function deserializeIntoResponse_usage_output_tokens_details(response_usa "tool_output_tokens": n => { response_usage_output_tokens_details.toolOutputTokens = n.getNumberValue(); }, } } +/** + * The deserialization information for the current model + * @param Retry_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoRetry_spec(retry_spec: Partial | undefined = {}) : Record void> { + return { + "backoff": n => { retry_spec.backoff = n.getStringValue(); }, + "maxAttempts": n => { retry_spec.maxAttempts = n.getNumberValue(); }, + "retryOn": n => { retry_spec.retryOn = n.getCollectionOfPrimitiveValues(); }, + } +} /** * The deserialization information for the current model * @param Routing_agent The instance to deserialize into. @@ -33369,6 +34652,65 @@ export function deserializeIntoSelective_destroy_associated_resource(selective_d "volume_snapshots": n => { selective_destroy_associated_resource.volumeSnapshots = n.getCollectionOfPrimitiveValues(); }, } } +/** + * The deserialization information for the current model + * @param Session_policy_rule The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoSession_policy_rule(session_policy_rule: Partial | undefined = {}) : Record void> { + return { + "action": n => { session_policy_rule.action = n.getEnumValue(Session_policy_actionObject) ?? Session_policy_actionObject.Ask; }, + "match": n => { session_policy_rule.match = n.getObjectValue(createSession_policy_rule_matchFromDiscriminatorValue); }, + "tool": n => { session_policy_rule.tool = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Session_policy_rule_match The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoSession_policy_rule_match(session_policy_rule_match: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Session_policy_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoSession_policy_spec(session_policy_spec: Partial | undefined = {}) : Record void> { + return { + "defaultAction": n => { session_policy_spec.defaultAction = n.getEnumValue(Session_policy_actionObject) ?? Session_policy_actionObject.Ask; }, + "rules": n => { session_policy_spec.rules = n.getCollectionOfObjectValues(createSession_policy_ruleFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Session_tool_reference The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoSession_tool_reference(session_tool_reference: Partial | undefined = {}) : Record void> { + return { + "kind": n => { session_tool_reference.kind = n.getEnumValue(Session_tool_reference_kindObject); }, + "name": n => { session_tool_reference.name = n.getStringValue(); }, + "version": n => { session_tool_reference.version = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Session_tool_selection The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoSession_tool_selection(session_tool_selection: Partial | undefined = {}) : Record void> { + return { + "references": n => { session_tool_selection.references = n.getCollectionOfObjectValues(createSession_tool_referenceFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param Settings The instance to deserialize into. @@ -33815,6 +35157,250 @@ export function deserializeIntoTimescaledb_advanced_config(timescaledb_advanced_ "max_background_workers": n => { timescaledb_advanced_config.maxBackgroundWorkers = n.getNumberValue(); }, } } +/** + * The deserialization information for the current model + * @param Tool The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool(tool: Partial | undefined = {}) : Record void> { + return { + "annotations": n => { tool.annotations = n.getObjectValue(createTool_annotationsFromDiscriminatorValue); }, + "description": n => { tool.description = n.getStringValue(); }, + "inputSchema": n => { tool.inputSchema = n.getObjectValue(createTool_inputSchemaFromDiscriminatorValue); }, + "name": n => { tool.name = n.getStringValue(); }, + "outputSchema": n => { tool.outputSchema = n.getObjectValue(createTool_outputSchemaFromDiscriminatorValue); }, + "parallelizable": n => { tool.parallelizable = n.getBooleanValue(); }, + "streamingSafe": n => { tool.streamingSafe = n.getBooleanValue(); }, + "title": n => { tool.title = n.getStringValue(); }, + "toolkitId": n => { tool.toolkitId = n.getStringValue(); }, + "toolSlug": n => { tool.toolSlug = n.getStringValue(); }, + "version": n => { tool.version = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Tool_annotations The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool_annotations(tool_annotations: Partial | undefined = {}) : Record void> { + return { + "destructiveHint": n => { tool_annotations.destructiveHint = n.getBooleanValue(); }, + "idempotentHint": n => { tool_annotations.idempotentHint = n.getBooleanValue(); }, + "openWorldHint": n => { tool_annotations.openWorldHint = n.getBooleanValue(); }, + "readOnlyHint": n => { tool_annotations.readOnlyHint = n.getBooleanValue(); }, + "title": n => { tool_annotations.title = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Tool_definition The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool_definition(tool_definition: Partial | undefined = {}) : Record void> { + return { + "annotations": n => { tool_definition.annotations = n.getObjectValue(createTool_annotationsFromDiscriminatorValue); }, + "auth": n => { tool_definition.auth = n.getObjectValue(createAuth_specFromDiscriminatorValue); }, + "classification": n => { tool_definition.classification = n.getObjectValue(createClassificationFromDiscriminatorValue); }, + "description": n => { tool_definition.description = n.getStringValue(); }, + "execution": n => { tool_definition.execution = n.getObjectValue(createExecution_specFromDiscriminatorValue); }, + "flipperName": n => { tool_definition.flipperName = n.getStringValue(); }, + "hooks": n => { tool_definition.hooks = n.getObjectValue(createHook_specFromDiscriminatorValue); }, + "inputSchema": n => { tool_definition.inputSchema = n.getObjectValue(createTool_definition_inputSchemaFromDiscriminatorValue); }, + "name": n => { tool_definition.name = n.getStringValue(); }, + "outputSchema": n => { tool_definition.outputSchema = n.getObjectValue(createTool_definition_outputSchemaFromDiscriminatorValue); }, + "parallelizable": n => { tool_definition.parallelizable = n.getBooleanValue(); }, + "policy": n => { tool_definition.policy = n.getObjectValue(createPolicy_specFromDiscriminatorValue); }, + "reliability": n => { tool_definition.reliability = n.getObjectValue(createReliability_specFromDiscriminatorValue); }, + "schemaVersion": n => { tool_definition.schemaVersion = n.getStringValue(); }, + "status": n => { tool_definition.status = n.getStringValue(); }, + "streamingSafe": n => { tool_definition.streamingSafe = n.getBooleanValue(); }, + "tags": n => { tool_definition.tags = n.getCollectionOfPrimitiveValues(); }, + "title": n => { tool_definition.title = n.getStringValue(); }, + "toolId": n => { tool_definition.toolId = n.getStringValue(); }, + "toolkitId": n => { tool_definition.toolkitId = n.getStringValue(); }, + "toolSlug": n => { tool_definition.toolSlug = n.getStringValue(); }, + "transform": n => { tool_definition.transform = n.getObjectValue(createTransform_specFromDiscriminatorValue); }, + "version": n => { tool_definition.version = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Tool_definition_inputSchema The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool_definition_inputSchema(tool_definition_inputSchema: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Tool_definition_outputSchema The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool_definition_outputSchema(tool_definition_outputSchema: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Tool_inputSchema The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool_inputSchema(tool_inputSchema: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Tool_outputSchema The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTool_outputSchema(tool_outputSchema: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Toolbelt The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolbelt(toolbelt: Partial | undefined = {}) : Record void> { + return { + "created_at": n => { toolbelt.createdAt = n.getDateValue(); }, + "description": n => { toolbelt.description = n.getStringValue(); }, + "display_name": n => { toolbelt.displayName = n.getStringValue(); }, + "name": n => { toolbelt.name = n.getStringValue(); }, + "reference": n => { toolbelt.reference = n.getStringValue(); }, + "reference_latest": n => { toolbelt.referenceLatest = n.getStringValue(); }, + "status": n => { toolbelt.status = n.getEnumValue(Toolbelt_statusObject); }, + "tool_count": n => { toolbelt.toolCount = n.getNumberValue(); }, + "tools": n => { toolbelt.tools = n.getCollectionOfPrimitiveValues(); }, + "updated_at": n => { toolbelt.updatedAt = n.getDateValue(); }, + "version": n => { toolbelt.version = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Toolbelt_create The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolbelt_create(toolbelt_create: Partial | undefined = {}) : Record void> { + return { + "description": n => { toolbelt_create.description = n.getStringValue(); }, + "display_name": n => { toolbelt_create.displayName = n.getStringValue(); }, + "name": n => { toolbelt_create.name = n.getStringValue(); }, + "tools": n => { toolbelt_create.tools = n.getCollectionOfPrimitiveValues(); }, + "version": n => { toolbelt_create.version = n.getStringValue() ?? "1"; }, + } +} +/** + * The deserialization information for the current model + * @param Toolbelt_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolbelt_response(toolbelt_response: Partial | undefined = {}) : Record void> { + return { + "toolbelt": n => { toolbelt_response.toolbelt = n.getObjectValue(createToolbeltFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Toolbelt_summary The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolbelt_summary(toolbelt_summary: Partial | undefined = {}) : Record void> { + return { + "description": n => { toolbelt_summary.description = n.getStringValue(); }, + "display_name": n => { toolbelt_summary.displayName = n.getStringValue(); }, + "latest_version": n => { toolbelt_summary.latestVersion = n.getStringValue(); }, + "name": n => { toolbelt_summary.name = n.getStringValue(); }, + "reference_latest": n => { toolbelt_summary.referenceLatest = n.getStringValue(); }, + "status": n => { toolbelt_summary.status = n.getEnumValue(Toolbelt_summary_statusObject); }, + "tool_count": n => { toolbelt_summary.toolCount = n.getNumberValue(); }, + "updated_at": n => { toolbelt_summary.updatedAt = n.getDateValue(); }, + "version_count": n => { toolbelt_summary.versionCount = n.getNumberValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Toolbelt_tools The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolbelt_tools(toolbelt_tools: Partial | undefined = {}) : Record void> { + return { + "tools": n => { toolbelt_tools.tools = n.getCollectionOfPrimitiveValues(); }, + } +} +/** + * The deserialization information for the current model + * @param Toolbelts_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolbelts_response(toolbelts_response: Partial | undefined = {}) : Record void> { + return { + "pagination": n => { toolbelts_response.pagination = n.getObjectValue(createPaginationFromDiscriminatorValue); }, + "toolbelts": n => { toolbelts_response.toolbelts = n.getCollectionOfObjectValues(createToolbelt_summaryFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Toolkit The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoToolkit(toolkit: Partial | undefined = {}) : Record void> { + return { + "description": n => { toolkit.description = n.getStringValue(); }, + "id": n => { toolkit.id = n.getStringValue(); }, + "name": n => { toolkit.name = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Transform_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTransform_spec(transform_spec: Partial | undefined = {}) : Record void> { + return { + "input": n => { transform_spec.input = n.getObjectValue(createTransform_spec_inputFromDiscriminatorValue); }, + "language": n => { transform_spec.language = n.getStringValue(); }, + "output": n => { transform_spec.output = n.getObjectValue(createTransform_spec_outputFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param Transform_spec_input The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTransform_spec_input(transform_spec_input: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Transform_spec_output The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoTransform_spec_output(transform_spec_output: Partial | undefined = {}) : Record void> { + return { + } +} /** * The deserialization information for the current model * @param Trigger_info The instance to deserialize into. @@ -33846,6 +35432,39 @@ export function deserializeIntoTrigger_info_scheduled_runs(trigger_info_schedule "next_run_at": n => { trigger_info_scheduled_runs.nextRunAt = n.getStringValue(); }, } } +/** + * The deserialization information for the current model + * @param Update_connection_parameters_request The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUpdate_connection_parameters_request(update_connection_parameters_request: Partial | undefined = {}) : Record void> { + return { + "connection_parameters": n => { update_connection_parameters_request.connectionParameters = n.getObjectValue(createUpdate_connection_parameters_request_connection_parametersFromDiscriminatorValue); }, + "id": n => { update_connection_parameters_request.id = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Update_connection_parameters_request_connection_parameters The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUpdate_connection_parameters_request_connection_parameters(update_connection_parameters_request_connection_parameters: Partial | undefined = {}) : Record void> { + return { + } +} +/** + * The deserialization information for the current model + * @param Update_connection_parameters_response The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUpdate_connection_parameters_response(update_connection_parameters_response: Partial | undefined = {}) : Record void> { + return { + "connection": n => { update_connection_parameters_response.connection = n.getObjectValue(createOauth_connectionFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param Update_endpoint The instance to deserialize into. @@ -33882,6 +35501,31 @@ export function deserializeIntoUpdate_trigger(update_trigger: Partial { update_trigger.scheduledDetails = n.getObjectValue(createScheduled_detailsFromDiscriminatorValue); }, } } +/** + * The deserialization information for the current model + * @param Usage_meter The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUsage_meter(usage_meter: Partial | undefined = {}) : Record void> { + return { + "quantitySource": n => { usage_meter.quantitySource = n.getStringValue(); }, + "sku": n => { usage_meter.sku = n.getStringValue(); }, + "unit": n => { usage_meter.unit = n.getStringValue(); }, + } +} +/** + * The deserialization information for the current model + * @param Usage_spec The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUsage_spec(usage_spec: Partial | undefined = {}) : Record void> { + return { + "billable": n => { usage_spec.billable = n.getBooleanValue(); }, + "meters": n => { usage_spec.meters = n.getCollectionOfObjectValues(createUsage_meterFromDiscriminatorValue); }, + } +} /** * The deserialization information for the current model * @param User The instance to deserialize into. @@ -33890,19 +35534,23 @@ export function deserializeIntoUpdate_trigger(update_trigger: Partial | undefined = {}) : Record void> { return { - "kubernetes_cluster_user": n => { user.kubernetesClusterUser = n.getObjectValue(createUser_kubernetes_cluster_userFromDiscriminatorValue); }, + "connections": n => { user.connections = n.getCollectionOfObjectValues(createOauth_connectionFromDiscriminatorValue); }, + "sessions": n => { user.sessions = n.getCollectionOfObjectValues(createUser_sessionFromDiscriminatorValue); }, + "user_id": n => { user.userId = n.getStringValue(); }, } } /** * The deserialization information for the current model - * @param User_kubernetes_cluster_user The instance to deserialize into. + * @param User_session The instance to deserialize into. * @returns {Record void>} */ // @ts-ignore -export function deserializeIntoUser_kubernetes_cluster_user(user_kubernetes_cluster_user: Partial | undefined = {}) : Record void> { +export function deserializeIntoUser_session(user_session: Partial | undefined = {}) : Record void> { return { - "groups": n => { user_kubernetes_cluster_user.groups = n.getCollectionOfPrimitiveValues(); }, - "username": n => { user_kubernetes_cluster_user.username = n.getStringValue(); }, + "created_at": n => { user_session.createdAt = n.getDateValue(); }, + "name": n => { user_session.name = n.getStringValue(); }, + "session_urn": n => { user_session.sessionUrn = n.getStringValue(); }, + "updated_at": n => { user_session.updatedAt = n.getDateValue(); }, } } /** @@ -33956,6 +35604,29 @@ export function deserializeIntoUser_settings_opensearch_acl(user_settings_opense "permission": n => { user_settings_opensearch_acl.permission = n.getEnumValue(User_settings_opensearch_acl_permissionObject); }, } } +/** + * The deserialization information for the current model + * @param User2 The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUser2(user2: Partial | undefined = {}) : Record void> { + return { + "kubernetes_cluster_user": n => { user2.kubernetesClusterUser = n.getObjectValue(createUser2_kubernetes_cluster_userFromDiscriminatorValue); }, + } +} +/** + * The deserialization information for the current model + * @param User2_kubernetes_cluster_user The instance to deserialize into. + * @returns {Record void>} + */ +// @ts-ignore +export function deserializeIntoUser2_kubernetes_cluster_user(user2_kubernetes_cluster_user: Partial | undefined = {}) : Record void> { + return { + "groups": n => { user2_kubernetes_cluster_user.groups = n.getCollectionOfPrimitiveValues(); }, + "username": n => { user2_kubernetes_cluster_user.username = n.getStringValue(); }, + } +} /** * The deserialization information for the current model * @param Validate_registry The instance to deserialize into. @@ -35241,6 +36912,28 @@ export interface Events_logs extends AdditionalDataHolder, Parsable { } export type Events_logs_event_type = (typeof Events_logs_event_typeObject)[keyof typeof Events_logs_event_typeObject]; export type Eviction_policy_model = (typeof Eviction_policy_modelObject)[keyof typeof Eviction_policy_modelObject]; +export interface Execution_spec extends Parsable { + /** + * The adapterVersion property + */ + adapterVersion?: string | null; + /** + * The configRef property + */ + configRef?: string | null; + /** + * The http property + */ + http?: Http_execution | null; + /** + * MCPExecution describes how to invoke a tool that is fronted by a remoteMCP server (as opposed to a plain HTTP endpoint). endpoint is the remoteMCP server's URL, tool_name is the name the remote server expects ontools/call (may differ from this tool's registry name), transportselects the wire protocol ("streamable_http" is the only kind implementedtoday), and server_ref is an opaque label identifying the remote serverfor logging/metrics/allowlisting. + */ + mcp?: Mcp_execution | null; + /** + * The type property + */ + type?: string | null; +} export interface Firewall extends Firewall_rules, Parsable { /** * A time value given in ISO8601 combined date and time format that represents when the firewall was created. @@ -35550,6 +37243,22 @@ export interface Generated_image extends AdditionalDataHolder, Parsable { */ revisedPrompt?: string | null; } +export interface Get_connection_response extends Parsable { + /** + * ConnectionAuthorization is present only while a connection is pending. TheUI sends the user to connect_url and polls GetConnection until the connectionbecomes active or expires. The Secrets Manager poll URL is never exposed. + */ + authorization?: Connection_authorization | null; + /** + * -----------------------------------------------------------------------------OAuth connection resources-----------------------------------------------------------------------------OAuthConnection is the public, team-scoped connection metadata returned tothe UI. It deliberately excludes the team ID, Secrets Manager assignment,actor identifiers, poll URL, and authorization handle. + */ + connection?: Oauth_connection | null; +} +export interface Get_user_response extends Parsable { + /** + * User is a derived, team-scoped view across sessions and OAuth connections. + */ + user?: User | null; +} /** * An object specifying forwarding configurations for a Global load balancer. */ @@ -35693,6 +37402,83 @@ export interface History extends AdditionalDataHolder, Parsable { } export type History_reason = (typeof History_reasonObject)[keyof typeof History_reasonObject]; export type History_status = (typeof History_statusObject)[keyof typeof History_statusObject]; +export interface Hook_spec extends Parsable { + /** + * The usage property + */ + usage?: Usage_spec | null; +} +export interface Http_execution extends Parsable { + /** + * The allowedHosts property + */ + allowedHosts?: string[] | null; + /** + * The baseUrl property + */ + baseUrl?: string | null; + /** + * The method property + */ + method?: string | null; + /** + * The path property + */ + path?: string | null; + /** + * The requestEncoding property + */ + requestEncoding?: string | null; + /** + * The responseFormat property + */ + responseFormat?: string | null; +} +/** + * HTTPLookupSpec resolves a base_url by calling url (bearer-authenticatedwith the just-exchanged access token), selecting an entry in the JSON array,extracting extract_field from that entry, and substituting it for "{value}"in base_url_template. When match_field and match_value are both set, theyselect the entry. When both are empty, exactly one entry whose own "scopes"array contains required_scopes must exist. Configuring only one match fieldis invalid. Resolution fails fast on zero or multiple compatible entries. + */ +export interface Http_lookup_spec extends Parsable { + /** + * The baseUrlTemplate property + */ + baseUrlTemplate?: string | null; + /** + * The caseInsensitive property + */ + caseInsensitive?: boolean | null; + /** + * The extractField property + */ + extractField?: string | null; + /** + * The matchField property + */ + matchField?: string | null; + /** + * The matchValue property + */ + matchValue?: string | null; + /** + * The match_value_parameter property + */ + matchValueParameter?: string | null; + /** + * The method property + */ + method?: string | null; + /** + * The requiredScopes property + */ + requiredScopes?: string[] | null; + /** + * The trimTrailingSlash property + */ + trimTrailingSlash?: boolean | null; + /** + * The url property + */ + url?: string | null; +} export interface Image extends AdditionalDataHolder, Parsable { /** * A time value given in ISO8601 combined date and time format that represents when the image was created. @@ -36632,6 +38418,16 @@ export interface Lb_firewall extends AdditionalDataHolder, Parsable { */ deny?: string[] | null; } +export interface List_connections_response extends Parsable { + /** + * The connections property + */ + connections?: Oauth_connection[] | null; + /** + * The pagination property + */ + pagination?: Pagination | null; +} /** * Response listing available models. */ @@ -36646,6 +38442,60 @@ export interface List_models_response extends AdditionalDataHolder, Parsable { object?: List_models_response_object | null; } export type List_models_response_object = (typeof List_models_response_objectObject)[keyof typeof List_models_response_objectObject]; +export interface List_providers_response extends Parsable { + /** + * The providers property + */ + providers?: Provider_summary[] | null; +} +export interface List_sessions_response extends Parsable { + /** + * The pagination property + */ + pagination?: Pagination | null; + /** + * The sessions property + */ + sessions?: Public_session_policy[] | null; +} +export interface List_toolkits_response extends Parsable { + /** + * The toolkits property + */ + toolkits?: Toolkit[] | null; + /** + * The version property + */ + version?: string | null; +} +export interface List_tools_response extends Parsable { + /** + * The definitions property + */ + definitions?: Tool_definition[] | null; + /** + * The pagination property + */ + pagination?: Pagination | null; + /** + * The tools property + */ + tools?: Tool[] | null; + /** + * The version property + */ + version?: string | null; +} +export interface List_users_response extends Parsable { + /** + * The pagination property + */ + pagination?: Pagination | null; + /** + * The user_ids property + */ + userIds?: string[] | null; +} export interface Load_balancer extends Load_balancer_base, Parsable { /** * An array containing the IDs of the Droplets assigned to the load balancer. @@ -36851,6 +38701,31 @@ export interface Maintenance_policy extends AdditionalDataHolder, Parsable { startTime?: string | null; } export type Maintenance_policy_day = (typeof Maintenance_policy_dayObject)[keyof typeof Maintenance_policy_dayObject]; +/** + * MCPExecution describes how to invoke a tool that is fronted by a remoteMCP server (as opposed to a plain HTTP endpoint). endpoint is the remoteMCP server's URL, tool_name is the name the remote server expects ontools/call (may differ from this tool's registry name), transportselects the wire protocol ("streamable_http" is the only kind implementedtoday), and server_ref is an opaque label identifying the remote serverfor logging/metrics/allowlisting. + */ +export interface Mcp_execution extends Parsable { + /** + * The allowedHosts property + */ + allowedHosts?: string[] | null; + /** + * The endpoint property + */ + endpoint?: string | null; + /** + * The serverRef property + */ + serverRef?: string | null; + /** + * The toolName property + */ + toolName?: string | null; + /** + * The transport property + */ + transport?: string | null; +} export interface Member extends AdditionalDataHolder, Parsable { /** * The creation time of the Droplet in ISO8601 combined date and time format. @@ -37958,6 +39833,57 @@ export interface Nvidia_gpu_device_plugin extends AdditionalDataHolder, Parsable */ enabled?: boolean | null; } +/** + * -----------------------------------------------------------------------------OAuth connection resources-----------------------------------------------------------------------------OAuthConnection is the public, team-scoped connection metadata returned tothe UI. It deliberately excludes the team ID, Secrets Manager assignment,actor identifiers, poll URL, and authorization handle. + */ +export interface Oauth_connection extends Parsable { + /** + * The connection_parameters property + */ + connectionParameters?: Oauth_connection_connection_parameters | null; + /** + * The created_at property + */ + createdAt?: Date | null; + /** + * The granted_at property + */ + grantedAt?: Date | null; + /** + * The id property + */ + id?: string | null; + /** + * The provider property + */ + provider?: string | null; + /** + * The provider_display_name property + */ + providerDisplayName?: string | null; + /** + * The revoked_at property + */ + revokedAt?: Date | null; + /** + * The scopes property + */ + scopes?: string[] | null; + /** + * The status property + */ + status?: string | null; + /** + * The updated_at property + */ + updatedAt?: Date | null; + /** + * The user_id property + */ + userId?: string | null; +} +export interface Oauth_connection_connection_parameters extends AdditionalDataHolder, Parsable { +} export interface OneClicks extends AdditionalDataHolder, Parsable { /** * The slug identifier for the 1-Click application. @@ -38620,12 +40546,26 @@ export interface Page_links extends AdditionalDataHolder, Parsable { export type Page_links_pages = Backward_links | Forward_links | Page_links_pagesMember1; export interface Page_links_pagesMember1 extends AdditionalDataHolder, Parsable { } -export interface Pagination extends AdditionalDataHolder, Parsable { +export interface Pages_pagination extends AdditionalDataHolder, Parsable { /** * The links property */ links?: Page_links | null; } +export interface Pagination extends Parsable { + /** + * The page property + */ + page?: number | null; + /** + * The per_page property + */ + perPage?: number | null; + /** + * The total property + */ + total?: number | null; +} export interface Partner_attachment extends AdditionalDataHolder, Parsable { /** * The BGP configuration for the partner attachment. @@ -38886,6 +40826,12 @@ export interface Pgbouncer_advanced_config extends AdditionalDataHolder, Parsabl } export type Pgbouncer_advanced_config_autodb_pool_mode = (typeof Pgbouncer_advanced_config_autodb_pool_modeObject)[keyof typeof Pgbouncer_advanced_config_autodb_pool_modeObject]; export type Pgbouncer_advanced_config_ignore_startup_parameters = (typeof Pgbouncer_advanced_config_ignore_startup_parametersObject)[keyof typeof Pgbouncer_advanced_config_ignore_startup_parametersObject]; +export interface Policy_spec extends Parsable { + /** + * The permission property + */ + permission?: string | null; +} export interface Postgres_advanced_config extends AdditionalDataHolder, Parsable { /** * Specifies a fraction, in a decimal value, of the table size to add to autovacuum_analyze_threshold when deciding whether to trigger an ANALYZE. The default is 0.2 (20% of table size). @@ -39217,6 +41163,74 @@ export interface Project_base extends AdditionalDataHolder, Parsable { updatedAt?: Date | null; } export type Project_base_environment = (typeof Project_base_environmentObject)[keyof typeof Project_base_environmentObject]; +export interface Provider_summary extends Parsable { + /** + * The auth_type property + */ + authType?: string | null; + /** + * The connection_parameters property + */ + connectionParameters?: Connection_parameter_spec[] | null; + /** + * The description property + */ + description?: string | null; + /** + * The display_name property + */ + displayName?: string | null; + /** + * The name property + */ + name?: string | null; + /** + * The scopes property + */ + scopes?: string[] | null; +} +/** + * A session and the tool-permission policy bound to it. + */ +export interface Public_session_policy extends Parsable { + /** + * actor_id is empty when the session is not bound to an actor. + */ + actorId?: string | null; + /** + * Preserved as an opaque object. Gateway currently interpretsconfig.preloadTools to add selected direct tools to the session MCP. + */ + config?: Public_session_policy_config | null; + /** + * The createdAt property + */ + createdAt?: Date | null; + /** + * name is the required human-readable session name. + */ + name?: string | null; + /** + * SessionPolicySpec is the Gateway-relevant subset of a session's permissionpolicy. Filesystem and network policy remain enforced by the sandbox. + */ + policy?: Session_policy_spec | null; + /** + * The sessionUrn property + */ + sessionUrn?: string | null; + /** + * Omitted when the request omitted tools (all tools). A present selectionwith no references represents tools: []. + */ + tools?: Session_tool_selection | null; + /** + * The updatedAt property + */ + updatedAt?: Date | null; +} +/** + * Preserved as an opaque object. Gateway currently interpretsconfig.preloadTools to add selected direct tools to the session MCP. + */ +export interface Public_session_policy_config extends AdditionalDataHolder, Parsable { +} export interface Purge_cache extends AdditionalDataHolder, Parsable { /** * An array of strings containing the path to the content to be purged from the CDN cache. @@ -39383,6 +41397,20 @@ export interface Registry_run_gc extends AdditionalDataHolder, Parsable { type?: Registry_run_gc_type | null; } export type Registry_run_gc_type = (typeof Registry_run_gc_typeObject)[keyof typeof Registry_run_gc_typeObject]; +export interface Reliability_spec extends Parsable { + /** + * The maxOutputBytes property + */ + maxOutputBytes?: string | null; + /** + * The retry property + */ + retry?: Retry_spec | null; + /** + * The timeoutMs property + */ + timeoutMs?: number | null; +} export interface Repository extends AdditionalDataHolder, Parsable { /** * The latest_tag property @@ -39664,6 +41692,20 @@ export interface Response_usage_output_tokens_details extends AdditionalDataHold */ toolOutputTokens?: number | null; } +export interface Retry_spec extends Parsable { + /** + * The backoff property + */ + backoff?: string | null; + /** + * The maxAttempts property + */ + maxAttempts?: number | null; + /** + * The retryOn property + */ + retryOn?: string[] | null; +} /** * An object specifying whether the routing-agent component should be enabled for the Kubernetes cluster. */ @@ -45162,7 +47204,7 @@ export function serializeApp_event_autoscaling_components(writer: SerializationW // @ts-ignore export function serializeApp_events(writer: SerializationWriter, app_events: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { if (!app_events || isSerializingDerivedType) { return; } - serializePagination(writer, app_events, isSerializingDerivedType) + serializePages_pagination(writer, app_events, isSerializingDerivedType) writer.writeCollectionOfObjectValues("events", app_events.events, serializeApp_event); } /** @@ -45472,7 +47514,7 @@ export function serializeApp_job_invocation_trigger_scheduled_schedule(writer: S // @ts-ignore export function serializeApp_job_invocations(writer: SerializationWriter, app_job_invocations: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { if (!app_job_invocations || isSerializingDerivedType) { return; } - serializePagination(writer, app_job_invocations, isSerializingDerivedType) + serializePages_pagination(writer, app_job_invocations, isSerializingDerivedType) writer.writeCollectionOfObjectValues("job_invocations", app_job_invocations.jobInvocations, serializeApp_job_invocation); } /** @@ -46675,6 +48717,37 @@ export function serializeAsync_invoke_response_output(writer: SerializationWrite if (!async_invoke_response_output || isSerializingDerivedType) { return; } writer.writeAdditionalData(async_invoke_response_output.additionalData); } +/** + * Serializes information the current object + * @param Auth_injection The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeAuth_injection(writer: SerializationWriter, auth_injection: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!auth_injection || isSerializingDerivedType) { return; } + writer.writeStringValue("location", auth_injection.location); + writer.writeStringValue("name", auth_injection.name); + writer.writeStringValue("scheme", auth_injection.scheme); +} +/** + * Serializes information the current object + * @param Auth_spec The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeAuth_spec(writer: SerializationWriter, auth_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!auth_spec || isSerializingDerivedType) { return; } + writer.writeObjectValue("baseUrlResolution", auth_spec.baseUrlResolution, serializeBase_url_resolution); + writer.writeStringValue("credentialBinding", auth_spec.credentialBinding); + writer.writeStringValue("credentialRefSource", auth_spec.credentialRefSource); + writer.writeStringValue("doManagedCredentialRef", auth_spec.doManagedCredentialRef); + writer.writeObjectValue("injection", auth_spec.injection, serializeAuth_injection); + writer.writeCollectionOfPrimitiveValues("modes", auth_spec.modes); + writer.writeStringValue("provider", auth_spec.provider); + writer.writeCollectionOfPrimitiveValues("scopes", auth_spec.scopes); +} /** * Serializes information the current object * @param Autoscale_pool The instance to serialize from. @@ -46824,6 +48897,17 @@ export function serializeBalance(writer: SerializationWriter, balance: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!base_url_resolution || isSerializingDerivedType) { return; } + writer.writeObjectValue("httpLookup", base_url_resolution.httpLookup, serializeHttp_lookup_spec); +} /** * Serializes information the current object * @param Batch The instance to serialize from. @@ -47524,6 +49608,19 @@ export function serializeCheck_updatable(writer: SerializationWriter, check_upda writer.writeEnumValue("type", check_updatable.type); writer.writeAdditionalData(check_updatable.additionalData); } +/** + * Serializes information the current object + * @param Classification The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeClassification(writer: SerializationWriter, classification: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!classification || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("dataClasses", classification.dataClasses); + writer.writeStringValue("operation", classification.operation); + writer.writeStringValue("risk", classification.risk); +} /** * Serializes information the current object * @param Cluster The instance to serialize from. @@ -47775,6 +49872,39 @@ export function serializeCompletion_usage_cache_creation(writer: SerializationWr writer.writeNumberValue("ephemeral_5m_input_tokens", completion_usage_cache_creation.ephemeral5mInputTokens); writer.writeAdditionalData(completion_usage_cache_creation.additionalData); } +/** + * Serializes information the current object + * @param Connection_authorization The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeConnection_authorization(writer: SerializationWriter, connection_authorization: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!connection_authorization || isSerializingDerivedType) { return; } + writer.writeStringValue("connect_url", connection_authorization.connectUrl); + writer.writeDateValue("expires_at", connection_authorization.expiresAt); + writer.writeStringValue("status", connection_authorization.status); + writer.writeStringValue("verification_code", connection_authorization.verificationCode); +} +/** + * Serializes information the current object + * @param Connection_parameter_spec The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeConnection_parameter_spec(writer: SerializationWriter, connection_parameter_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!connection_parameter_spec || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("allowed_host_suffixes", connection_parameter_spec.allowedHostSuffixes); + writer.writeCollectionOfPrimitiveValues("allowed_values", connection_parameter_spec.allowedValues); + writer.writeStringValue("description", connection_parameter_spec.description); + writer.writeStringValue("input_kind", connection_parameter_spec.inputKind); + writer.writeStringValue("key", connection_parameter_spec.key); + writer.writeStringValue("label", connection_parameter_spec.label); + writer.writeNumberValue("max_length", connection_parameter_spec.maxLength); + writer.writeStringValue("normalization", connection_parameter_spec.normalization); + writer.writeBooleanValue("required", connection_parameter_spec.required); +} /** * Serializes information the current object * @param Connection_pool The instance to serialize from. @@ -47846,6 +49976,43 @@ export function serializeCoredns_autoscaler(writer: SerializationWriter, coredns writer.writeBooleanValue("enabled", coredns_autoscaler.enabled); writer.writeAdditionalData(coredns_autoscaler.additionalData); } +/** + * Serializes information the current object + * @param Create_connection_request The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeCreate_connection_request(writer: SerializationWriter, create_connection_request: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!create_connection_request || isSerializingDerivedType) { return; } + writer.writeObjectValue("connection_parameters", create_connection_request.connectionParameters, serializeCreate_connection_request_connection_parameters); + writer.writeStringValue("provider", create_connection_request.provider); + writer.writeCollectionOfPrimitiveValues("scopes", create_connection_request.scopes); + writer.writeStringValue("user_id", create_connection_request.userId); +} +/** + * Serializes information the current object + * @param Create_connection_request_connection_parameters The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeCreate_connection_request_connection_parameters(writer: SerializationWriter, create_connection_request_connection_parameters: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!create_connection_request_connection_parameters || isSerializingDerivedType) { return; } + writer.writeAdditionalData(create_connection_request_connection_parameters.additionalData); +} +/** + * Serializes information the current object + * @param Create_connection_response The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeCreate_connection_response(writer: SerializationWriter, create_connection_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!create_connection_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("authorization", create_connection_response.authorization, serializeConnection_authorization); + writer.writeObjectValue("connection", create_connection_response.connection, serializeOauth_connection); +} /** * Serializes information the current object * @param Create_image_request The instance to serialize from. @@ -48150,6 +50317,46 @@ export function serializeCreate_team_request(writer: SerializationWriter, create writer.writeStringValue("name", create_team_request.name); writer.writeAdditionalData(create_team_request.additionalData); } +/** + * Serializes information the current object + * @param Create_session_request The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeCreate_session_request(writer: SerializationWriter, create_session_request: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!create_session_request || isSerializingDerivedType) { return; } + writer.writeStringValue("actor_id", create_session_request.actorId); + writer.writeObjectValue("config", create_session_request.config, serializeCreate_session_request_config); + writer.writeStringValue("name", create_session_request.name); + writer.writeObjectValue("policy", create_session_request.policy, serializeSession_policy_spec); + writer.writeCollectionOfPrimitiveValues("tools", create_session_request.tools); +} +/** + * Serializes information the current object + * @param Create_session_request_config The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeCreate_session_request_config(writer: SerializationWriter, create_session_request_config: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!create_session_request_config || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("preloadTools", create_session_request_config.preloadTools); + writer.writeAdditionalData(create_session_request_config.additionalData); +} +/** + * Serializes information the current object + * @param Create_session_response The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeCreate_session_response(writer: SerializationWriter, create_session_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!create_session_response || isSerializingDerivedType) { return; } + writer.writeStringValue("mcpUrl", create_session_response.mcpUrl); + writer.writeObjectValue("session", create_session_response.session, serializePublic_session_policy); + writer.writeCollectionOfPrimitiveValues("tools", create_session_response.tools); +} /** * Serializes information the current object * @param Create_trigger The instance to serialize from. @@ -48770,6 +50977,27 @@ export function serializeDedicated_inference_update_request_access_tokens(writer if (!dedicated_inference_update_request_access_tokens || isSerializingDerivedType) { return; } writer.writeStringValue("hugging_face_token", dedicated_inference_update_request_access_tokens.huggingFaceToken); } +/** + * Serializes information the current object + * @param Delete_connection_response The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeDelete_connection_response(writer: SerializationWriter, delete_connection_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!delete_connection_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("connection", delete_connection_response.connection, serializeOauth_connection); +} +/** + * Serializes information the current object + * @param Delete_session_response The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeDelete_session_response(writer: SerializationWriter, delete_session_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!delete_session_response || isSerializingDerivedType) { return; } +} /** * Serializes information the current object * @param Destination The instance to serialize from. @@ -49433,7 +51661,7 @@ export function serializeEmbeddings_request(writer: SerializationWriter, embeddi writer.writeStringValue("input", embeddings_request.input as string); } else { - writer.writeCollectionOfPrimitiveValues("input", embeddings_request.input); + writer.writeCollectionOfObjectValues("input", embeddings_request.input as string[] | undefined | null, serializeEmbeddings_request_input); } writer.writeStringValue("model", embeddings_request.model); writer.writeStringValue("user", embeddings_request.user); @@ -49525,6 +51753,21 @@ export function serializeEvents_logs(writer: SerializationWriter, events_logs: P writer.writeStringValue("id", events_logs.id); writer.writeAdditionalData(events_logs.additionalData); } +/** + * Serializes information the current object + * @param Execution_spec The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeExecution_spec(writer: SerializationWriter, execution_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!execution_spec || isSerializingDerivedType) { return; } + writer.writeStringValue("adapterVersion", execution_spec.adapterVersion); + writer.writeStringValue("configRef", execution_spec.configRef); + writer.writeObjectValue("http", execution_spec.http, serializeHttp_execution); + writer.writeObjectValue("mcp", execution_spec.mcp, serializeMcp_execution); + writer.writeStringValue("type", execution_spec.type); +} /** * Serializes information the current object * @param Firewall The instance to serialize from. @@ -49820,6 +52063,29 @@ export function serializeGenerated_image(writer: SerializationWriter, generated_ writer.writeStringValue("revised_prompt", generated_image.revisedPrompt); writer.writeAdditionalData(generated_image.additionalData); } +/** + * Serializes information the current object + * @param Get_connection_response The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeGet_connection_response(writer: SerializationWriter, get_connection_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!get_connection_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("authorization", get_connection_response.authorization, serializeConnection_authorization); + writer.writeObjectValue("connection", get_connection_response.connection, serializeOauth_connection); +} +/** + * Serializes information the current object + * @param Get_user_response The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeGet_user_response(writer: SerializationWriter, get_user_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!get_user_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("user", get_user_response.user, serializeUser); +} /** * Serializes information the current object * @param Glb_settings The instance to serialize from. @@ -49935,6 +52201,53 @@ export function serializeHistory(writer: SerializationWriter, history: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!hook_spec || isSerializingDerivedType) { return; } + writer.writeObjectValue("usage", hook_spec.usage, serializeUsage_spec); +} +/** + * Serializes information the current object + * @param Http_execution The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeHttp_execution(writer: SerializationWriter, http_execution: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!http_execution || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("allowedHosts", http_execution.allowedHosts); + writer.writeStringValue("baseUrl", http_execution.baseUrl); + writer.writeStringValue("method", http_execution.method); + writer.writeStringValue("path", http_execution.path); + writer.writeStringValue("requestEncoding", http_execution.requestEncoding); + writer.writeStringValue("responseFormat", http_execution.responseFormat); +} +/** + * Serializes information the current object + * @param Http_lookup_spec The instance to serialize from. + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeHttp_lookup_spec(writer: SerializationWriter, http_lookup_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!http_lookup_spec || isSerializingDerivedType) { return; } + writer.writeStringValue("baseUrlTemplate", http_lookup_spec.baseUrlTemplate); + writer.writeBooleanValue("caseInsensitive", http_lookup_spec.caseInsensitive); + writer.writeStringValue("extractField", http_lookup_spec.extractField); + writer.writeStringValue("matchField", http_lookup_spec.matchField); + writer.writeStringValue("matchValue", http_lookup_spec.matchValue); + writer.writeStringValue("match_value_parameter", http_lookup_spec.matchValueParameter); + writer.writeStringValue("method", http_lookup_spec.method); + writer.writeCollectionOfPrimitiveValues("requiredScopes", http_lookup_spec.requiredScopes); + writer.writeBooleanValue("trimTrailingSlash", http_lookup_spec.trimTrailingSlash); + writer.writeStringValue("url", http_lookup_spec.url); +} /** * Serializes information the current object * @param Image The instance to serialize from. @@ -50583,6 +52896,18 @@ export function serializeLb_firewall(writer: SerializationWriter, lb_firewall: P writer.writeCollectionOfPrimitiveValues("deny", lb_firewall.deny); writer.writeAdditionalData(lb_firewall.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param List_connections_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeList_connections_response(writer: SerializationWriter, list_connections_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!list_connections_response || isSerializingDerivedType) { return; } + writer.writeCollectionOfObjectValues("connections", list_connections_response.connections, serializeOauth_connection); + writer.writeObjectValue("pagination", list_connections_response.pagination, serializePagination); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -50596,6 +52921,67 @@ export function serializeList_models_response(writer: SerializationWriter, list_ writer.writeEnumValue("object", list_models_response.object); writer.writeAdditionalData(list_models_response.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param List_providers_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeList_providers_response(writer: SerializationWriter, list_providers_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!list_providers_response || isSerializingDerivedType) { return; } + writer.writeCollectionOfObjectValues("providers", list_providers_response.providers, serializeProvider_summary); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param List_sessions_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeList_sessions_response(writer: SerializationWriter, list_sessions_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!list_sessions_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("pagination", list_sessions_response.pagination, serializePagination); + writer.writeCollectionOfObjectValues("sessions", list_sessions_response.sessions, serializePublic_session_policy); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param List_toolkits_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeList_toolkits_response(writer: SerializationWriter, list_toolkits_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!list_toolkits_response || isSerializingDerivedType) { return; } + writer.writeCollectionOfObjectValues("toolkits", list_toolkits_response.toolkits, serializeToolkit); + writer.writeStringValue("version", list_toolkits_response.version); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param List_tools_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeList_tools_response(writer: SerializationWriter, list_tools_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!list_tools_response || isSerializingDerivedType) { return; } + writer.writeCollectionOfObjectValues("definitions", list_tools_response.definitions, serializeTool_definition); + writer.writeObjectValue("pagination", list_tools_response.pagination, serializePagination); + writer.writeCollectionOfObjectValues("tools", list_tools_response.tools, serializeTool); + writer.writeStringValue("version", list_tools_response.version); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param List_users_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeList_users_response(writer: SerializationWriter, list_users_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!list_users_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("pagination", list_users_response.pagination, serializePagination); + writer.writeCollectionOfPrimitiveValues("user_ids", list_users_response.userIds); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -50780,6 +53166,21 @@ export function serializeMaintenance_policy(writer: SerializationWriter, mainten writer.writeStringValue("start_time", maintenance_policy.startTime); writer.writeAdditionalData(maintenance_policy.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Mcp_execution The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeMcp_execution(writer: SerializationWriter, mcp_execution: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!mcp_execution || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("allowedHosts", mcp_execution.allowedHosts); + writer.writeStringValue("endpoint", mcp_execution.endpoint); + writer.writeStringValue("serverRef", mcp_execution.serverRef); + writer.writeStringValue("toolName", mcp_execution.toolName); + writer.writeStringValue("transport", mcp_execution.transport); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -51764,6 +54165,38 @@ export function serializeNvidia_gpu_device_plugin(writer: SerializationWriter, n writer.writeBooleanValue("enabled", nvidia_gpu_device_plugin.enabled); writer.writeAdditionalData(nvidia_gpu_device_plugin.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Oauth_connection The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeOauth_connection(writer: SerializationWriter, oauth_connection: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!oauth_connection || isSerializingDerivedType) { return; } + writer.writeObjectValue("connection_parameters", oauth_connection.connectionParameters, serializeOauth_connection_connection_parameters); + writer.writeDateValue("created_at", oauth_connection.createdAt); + writer.writeDateValue("granted_at", oauth_connection.grantedAt); + writer.writeStringValue("id", oauth_connection.id); + writer.writeStringValue("provider", oauth_connection.provider); + writer.writeStringValue("provider_display_name", oauth_connection.providerDisplayName); + writer.writeDateValue("revoked_at", oauth_connection.revokedAt); + writer.writeCollectionOfPrimitiveValues("scopes", oauth_connection.scopes); + writer.writeStringValue("status", oauth_connection.status); + writer.writeDateValue("updated_at", oauth_connection.updatedAt); + writer.writeStringValue("user_id", oauth_connection.userId); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Oauth_connection_connection_parameters The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeOauth_connection_connection_parameters(writer: SerializationWriter, oauth_connection_connection_parameters: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!oauth_connection_connection_parameters || isSerializingDerivedType) { return; } + writer.writeAdditionalData(oauth_connection_connection_parameters.additionalData); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -52204,6 +54637,18 @@ export function serializePage_links_pagesMember1(writer: SerializationWriter, pa if (!page_links_pagesMember1 || isSerializingDerivedType) { return; } writer.writeAdditionalData(page_links_pagesMember1.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Pages_pagination The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializePages_pagination(writer: SerializationWriter, pages_pagination: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!pages_pagination || isSerializingDerivedType) { return; } + writer.writeObjectValue("links", pages_pagination.links, serializePage_links); + writer.writeAdditionalData(pages_pagination.additionalData); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -52213,8 +54658,9 @@ export function serializePage_links_pagesMember1(writer: SerializationWriter, pa // @ts-ignore export function serializePagination(writer: SerializationWriter, pagination: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { if (!pagination || isSerializingDerivedType) { return; } - writer.writeObjectValue("links", pagination.links, serializePage_links); - writer.writeAdditionalData(pagination.additionalData); + writer.writeNumberValue("page", pagination.page); + writer.writeNumberValue("per_page", pagination.perPage); + writer.writeNumberValue("total", pagination.total); } /** * Serializes information the current object @@ -52397,6 +54843,17 @@ export function serializePgbouncer_advanced_config(writer: SerializationWriter, writer.writeBooleanValue("server_reset_query_always", pgbouncer_advanced_config.serverResetQueryAlways); writer.writeAdditionalData(pgbouncer_advanced_config.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Policy_spec The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializePolicy_spec(writer: SerializationWriter, policy_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!policy_spec || isSerializingDerivedType) { return; } + writer.writeStringValue("permission", policy_spec.permission); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -52546,6 +55003,51 @@ export function serializeProject_base(writer: SerializationWriter, project_base: writer.writeStringValue("purpose", project_base.purpose); writer.writeAdditionalData(project_base.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Provider_summary The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeProvider_summary(writer: SerializationWriter, provider_summary: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!provider_summary || isSerializingDerivedType) { return; } + writer.writeStringValue("auth_type", provider_summary.authType); + writer.writeCollectionOfObjectValues("connection_parameters", provider_summary.connectionParameters, serializeConnection_parameter_spec); + writer.writeStringValue("description", provider_summary.description); + writer.writeStringValue("display_name", provider_summary.displayName); + writer.writeStringValue("name", provider_summary.name); + writer.writeCollectionOfPrimitiveValues("scopes", provider_summary.scopes); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Public_session_policy The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializePublic_session_policy(writer: SerializationWriter, public_session_policy: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!public_session_policy || isSerializingDerivedType) { return; } + writer.writeStringValue("actorId", public_session_policy.actorId); + writer.writeObjectValue("config", public_session_policy.config, serializePublic_session_policy_config); + writer.writeDateValue("createdAt", public_session_policy.createdAt); + writer.writeStringValue("name", public_session_policy.name); + writer.writeObjectValue("policy", public_session_policy.policy, serializeSession_policy_spec); + writer.writeStringValue("sessionUrn", public_session_policy.sessionUrn); + writer.writeObjectValue("tools", public_session_policy.tools, serializeSession_tool_selection); + writer.writeDateValue("updatedAt", public_session_policy.updatedAt); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Public_session_policy_config The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializePublic_session_policy_config(writer: SerializationWriter, public_session_policy_config: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!public_session_policy_config || isSerializingDerivedType) { return; } + writer.writeAdditionalData(public_session_policy_config.additionalData); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -52686,6 +55188,19 @@ export function serializeRegistry_run_gc(writer: SerializationWriter, registry_r writer.writeEnumValue("type", registry_run_gc.type); writer.writeAdditionalData(registry_run_gc.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Reliability_spec The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeReliability_spec(writer: SerializationWriter, reliability_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!reliability_spec || isSerializingDerivedType) { return; } + writer.writeStringValue("maxOutputBytes", reliability_spec.maxOutputBytes); + writer.writeObjectValue("retry", reliability_spec.retry, serializeRetry_spec); + writer.writeNumberValue("timeoutMs", reliability_spec.timeoutMs); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -52989,6 +55504,19 @@ export function serializeResponse_usage_output_tokens_details(writer: Serializat writer.writeNumberValue("tool_output_tokens", response_usage_output_tokens_details.toolOutputTokens); writer.writeAdditionalData(response_usage_output_tokens_details.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Retry_spec The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeRetry_spec(writer: SerializationWriter, retry_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!retry_spec || isSerializingDerivedType) { return; } + writer.writeStringValue("backoff", retry_spec.backoff); + writer.writeNumberValue("maxAttempts", retry_spec.maxAttempts); + writer.writeCollectionOfPrimitiveValues("retryOn", retry_spec.retryOn); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -53122,6 +55650,66 @@ export function serializeSelective_destroy_associated_resource(writer: Serializa writer.writeCollectionOfPrimitiveValues("volume_snapshots", selective_destroy_associated_resource.volumeSnapshots); writer.writeAdditionalData(selective_destroy_associated_resource.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Session_policy_rule The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeSession_policy_rule(writer: SerializationWriter, session_policy_rule: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!session_policy_rule || isSerializingDerivedType) { return; } + writer.writeEnumValue("action", session_policy_rule.action ?? Session_policy_actionObject.Ask); + writer.writeObjectValue("match", session_policy_rule.match, serializeSession_policy_rule_match); + writer.writeStringValue("tool", session_policy_rule.tool); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Session_policy_rule_match The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeSession_policy_rule_match(writer: SerializationWriter, session_policy_rule_match: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!session_policy_rule_match || isSerializingDerivedType) { return; } + writer.writeAdditionalData(session_policy_rule_match.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Session_policy_spec The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeSession_policy_spec(writer: SerializationWriter, session_policy_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!session_policy_spec || isSerializingDerivedType) { return; } + writer.writeEnumValue("defaultAction", session_policy_spec.defaultAction ?? Session_policy_actionObject.Ask); + writer.writeCollectionOfObjectValues("rules", session_policy_spec.rules, serializeSession_policy_rule); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Session_tool_reference The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeSession_tool_reference(writer: SerializationWriter, session_tool_reference: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!session_tool_reference || isSerializingDerivedType) { return; } + writer.writeEnumValue("kind", session_tool_reference.kind); + writer.writeStringValue("name", session_tool_reference.name); + writer.writeStringValue("version", session_tool_reference.version); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Session_tool_selection The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeSession_tool_selection(writer: SerializationWriter, session_tool_selection: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!session_tool_selection || isSerializingDerivedType) { return; } + writer.writeCollectionOfObjectValues("references", session_tool_selection.references, serializeSession_tool_reference); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -53593,6 +56181,256 @@ export function serializeTimescaledb_advanced_config(writer: SerializationWriter writer.writeNumberValue("max_background_workers", timescaledb_advanced_config.maxBackgroundWorkers); writer.writeAdditionalData(timescaledb_advanced_config.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool(writer: SerializationWriter, tool: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool || isSerializingDerivedType) { return; } + writer.writeObjectValue("annotations", tool.annotations, serializeTool_annotations); + writer.writeStringValue("description", tool.description); + writer.writeObjectValue("inputSchema", tool.inputSchema, serializeTool_inputSchema); + writer.writeStringValue("name", tool.name); + writer.writeObjectValue("outputSchema", tool.outputSchema, serializeTool_outputSchema); + writer.writeBooleanValue("parallelizable", tool.parallelizable); + writer.writeBooleanValue("streamingSafe", tool.streamingSafe); + writer.writeStringValue("title", tool.title); + writer.writeStringValue("toolkitId", tool.toolkitId); + writer.writeStringValue("toolSlug", tool.toolSlug); + writer.writeStringValue("version", tool.version); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool_annotations The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool_annotations(writer: SerializationWriter, tool_annotations: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool_annotations || isSerializingDerivedType) { return; } + writer.writeBooleanValue("destructiveHint", tool_annotations.destructiveHint); + writer.writeBooleanValue("idempotentHint", tool_annotations.idempotentHint); + writer.writeBooleanValue("openWorldHint", tool_annotations.openWorldHint); + writer.writeBooleanValue("readOnlyHint", tool_annotations.readOnlyHint); + writer.writeStringValue("title", tool_annotations.title); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool_definition The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool_definition(writer: SerializationWriter, tool_definition: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool_definition || isSerializingDerivedType) { return; } + writer.writeObjectValue("annotations", tool_definition.annotations, serializeTool_annotations); + writer.writeObjectValue("auth", tool_definition.auth, serializeAuth_spec); + writer.writeObjectValue("classification", tool_definition.classification, serializeClassification); + writer.writeStringValue("description", tool_definition.description); + writer.writeObjectValue("execution", tool_definition.execution, serializeExecution_spec); + writer.writeStringValue("flipperName", tool_definition.flipperName); + writer.writeObjectValue("hooks", tool_definition.hooks, serializeHook_spec); + writer.writeObjectValue("inputSchema", tool_definition.inputSchema, serializeTool_definition_inputSchema); + writer.writeStringValue("name", tool_definition.name); + writer.writeObjectValue("outputSchema", tool_definition.outputSchema, serializeTool_definition_outputSchema); + writer.writeBooleanValue("parallelizable", tool_definition.parallelizable); + writer.writeObjectValue("policy", tool_definition.policy, serializePolicy_spec); + writer.writeObjectValue("reliability", tool_definition.reliability, serializeReliability_spec); + writer.writeStringValue("schemaVersion", tool_definition.schemaVersion); + writer.writeStringValue("status", tool_definition.status); + writer.writeBooleanValue("streamingSafe", tool_definition.streamingSafe); + writer.writeCollectionOfPrimitiveValues("tags", tool_definition.tags); + writer.writeStringValue("title", tool_definition.title); + writer.writeStringValue("toolId", tool_definition.toolId); + writer.writeStringValue("toolkitId", tool_definition.toolkitId); + writer.writeStringValue("toolSlug", tool_definition.toolSlug); + writer.writeObjectValue("transform", tool_definition.transform, serializeTransform_spec); + writer.writeStringValue("version", tool_definition.version); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool_definition_inputSchema The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool_definition_inputSchema(writer: SerializationWriter, tool_definition_inputSchema: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool_definition_inputSchema || isSerializingDerivedType) { return; } + writer.writeAdditionalData(tool_definition_inputSchema.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool_definition_outputSchema The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool_definition_outputSchema(writer: SerializationWriter, tool_definition_outputSchema: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool_definition_outputSchema || isSerializingDerivedType) { return; } + writer.writeAdditionalData(tool_definition_outputSchema.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool_inputSchema The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool_inputSchema(writer: SerializationWriter, tool_inputSchema: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool_inputSchema || isSerializingDerivedType) { return; } + writer.writeAdditionalData(tool_inputSchema.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Tool_outputSchema The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTool_outputSchema(writer: SerializationWriter, tool_outputSchema: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!tool_outputSchema || isSerializingDerivedType) { return; } + writer.writeAdditionalData(tool_outputSchema.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolbelt The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolbelt(writer: SerializationWriter, toolbelt: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolbelt || isSerializingDerivedType) { return; } + writer.writeDateValue("created_at", toolbelt.createdAt); + writer.writeStringValue("description", toolbelt.description); + writer.writeStringValue("display_name", toolbelt.displayName); + writer.writeStringValue("name", toolbelt.name); + writer.writeStringValue("reference", toolbelt.reference); + writer.writeStringValue("reference_latest", toolbelt.referenceLatest); + writer.writeEnumValue("status", toolbelt.status); + writer.writeNumberValue("tool_count", toolbelt.toolCount); + writer.writeCollectionOfPrimitiveValues("tools", toolbelt.tools); + writer.writeDateValue("updated_at", toolbelt.updatedAt); + writer.writeStringValue("version", toolbelt.version); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolbelt_create The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolbelt_create(writer: SerializationWriter, toolbelt_create: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolbelt_create || isSerializingDerivedType) { return; } + writer.writeStringValue("description", toolbelt_create.description); + writer.writeStringValue("display_name", toolbelt_create.displayName); + writer.writeStringValue("name", toolbelt_create.name); + writer.writeCollectionOfPrimitiveValues("tools", toolbelt_create.tools); + writer.writeStringValue("version", toolbelt_create.version ?? "1"); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolbelt_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolbelt_response(writer: SerializationWriter, toolbelt_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolbelt_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("toolbelt", toolbelt_response.toolbelt, serializeToolbelt); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolbelt_summary The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolbelt_summary(writer: SerializationWriter, toolbelt_summary: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolbelt_summary || isSerializingDerivedType) { return; } + writer.writeStringValue("description", toolbelt_summary.description); + writer.writeStringValue("display_name", toolbelt_summary.displayName); + writer.writeStringValue("latest_version", toolbelt_summary.latestVersion); + writer.writeStringValue("name", toolbelt_summary.name); + writer.writeStringValue("reference_latest", toolbelt_summary.referenceLatest); + writer.writeEnumValue("status", toolbelt_summary.status); + writer.writeNumberValue("tool_count", toolbelt_summary.toolCount); + writer.writeDateValue("updated_at", toolbelt_summary.updatedAt); + writer.writeNumberValue("version_count", toolbelt_summary.versionCount); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolbelt_tools The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolbelt_tools(writer: SerializationWriter, toolbelt_tools: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolbelt_tools || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("tools", toolbelt_tools.tools); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolbelts_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolbelts_response(writer: SerializationWriter, toolbelts_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolbelts_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("pagination", toolbelts_response.pagination, serializePagination); + writer.writeCollectionOfObjectValues("toolbelts", toolbelts_response.toolbelts, serializeToolbelt_summary); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Toolkit The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeToolkit(writer: SerializationWriter, toolkit: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!toolkit || isSerializingDerivedType) { return; } + writer.writeStringValue("description", toolkit.description); + writer.writeStringValue("id", toolkit.id); + writer.writeStringValue("name", toolkit.name); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Transform_spec The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTransform_spec(writer: SerializationWriter, transform_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!transform_spec || isSerializingDerivedType) { return; } + writer.writeObjectValue("input", transform_spec.input, serializeTransform_spec_input); + writer.writeStringValue("language", transform_spec.language); + writer.writeObjectValue("output", transform_spec.output, serializeTransform_spec_output); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Transform_spec_input The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTransform_spec_input(writer: SerializationWriter, transform_spec_input: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!transform_spec_input || isSerializingDerivedType) { return; } + writer.writeAdditionalData(transform_spec_input.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Transform_spec_output The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeTransform_spec_output(writer: SerializationWriter, transform_spec_output: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!transform_spec_output || isSerializingDerivedType) { return; } + writer.writeAdditionalData(transform_spec_output.additionalData); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -53626,6 +56464,40 @@ export function serializeTrigger_info_scheduled_runs(writer: SerializationWriter writer.writeStringValue("next_run_at", trigger_info_scheduled_runs.nextRunAt); writer.writeAdditionalData(trigger_info_scheduled_runs.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Update_connection_parameters_request The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUpdate_connection_parameters_request(writer: SerializationWriter, update_connection_parameters_request: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!update_connection_parameters_request || isSerializingDerivedType) { return; } + writer.writeObjectValue("connection_parameters", update_connection_parameters_request.connectionParameters, serializeUpdate_connection_parameters_request_connection_parameters); + writer.writeStringValue("id", update_connection_parameters_request.id); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Update_connection_parameters_request_connection_parameters The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUpdate_connection_parameters_request_connection_parameters(writer: SerializationWriter, update_connection_parameters_request_connection_parameters: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!update_connection_parameters_request_connection_parameters || isSerializingDerivedType) { return; } + writer.writeAdditionalData(update_connection_parameters_request_connection_parameters.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Update_connection_parameters_response The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUpdate_connection_parameters_response(writer: SerializationWriter, update_connection_parameters_response: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!update_connection_parameters_response || isSerializingDerivedType) { return; } + writer.writeObjectValue("connection", update_connection_parameters_response.connection, serializeOauth_connection); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -53665,6 +56537,31 @@ export function serializeUpdate_trigger(writer: SerializationWriter, update_trig writer.writeObjectValue("scheduled_details", update_trigger.scheduledDetails, serializeScheduled_details); writer.writeAdditionalData(update_trigger.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Usage_meter The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUsage_meter(writer: SerializationWriter, usage_meter: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!usage_meter || isSerializingDerivedType) { return; } + writer.writeStringValue("quantitySource", usage_meter.quantitySource); + writer.writeStringValue("sku", usage_meter.sku); + writer.writeStringValue("unit", usage_meter.unit); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param Usage_spec The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUsage_spec(writer: SerializationWriter, usage_spec: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!usage_spec || isSerializingDerivedType) { return; } + writer.writeBooleanValue("billable", usage_spec.billable); + writer.writeCollectionOfObjectValues("meters", usage_spec.meters, serializeUsage_meter); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -53674,21 +56571,23 @@ export function serializeUpdate_trigger(writer: SerializationWriter, update_trig // @ts-ignore export function serializeUser(writer: SerializationWriter, user: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { if (!user || isSerializingDerivedType) { return; } - writer.writeObjectValue("kubernetes_cluster_user", user.kubernetesClusterUser, serializeUser_kubernetes_cluster_user); - writer.writeAdditionalData(user.additionalData); + writer.writeCollectionOfObjectValues("connections", user.connections, serializeOauth_connection); + writer.writeCollectionOfObjectValues("sessions", user.sessions, serializeUser_session); + writer.writeStringValue("user_id", user.userId); } /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. - * @param User_kubernetes_cluster_user The instance to serialize from. + * @param User_session The instance to serialize from. * @param writer Serialization writer to use to serialize this model */ // @ts-ignore -export function serializeUser_kubernetes_cluster_user(writer: SerializationWriter, user_kubernetes_cluster_user: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { - if (!user_kubernetes_cluster_user || isSerializingDerivedType) { return; } - writer.writeCollectionOfPrimitiveValues("groups", user_kubernetes_cluster_user.groups); - writer.writeStringValue("username", user_kubernetes_cluster_user.username); - writer.writeAdditionalData(user_kubernetes_cluster_user.additionalData); +export function serializeUser_session(writer: SerializationWriter, user_session: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!user_session || isSerializingDerivedType) { return; } + writer.writeDateValue("created_at", user_session.createdAt); + writer.writeStringValue("name", user_session.name); + writer.writeStringValue("session_urn", user_session.sessionUrn); + writer.writeDateValue("updated_at", user_session.updatedAt); } /** * Serializes information the current object @@ -53745,6 +56644,31 @@ export function serializeUser_settings_opensearch_acl(writer: SerializationWrite writer.writeEnumValue("permission", user_settings_opensearch_acl.permission); writer.writeAdditionalData(user_settings_opensearch_acl.additionalData); } +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param User2 The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUser2(writer: SerializationWriter, user2: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!user2 || isSerializingDerivedType) { return; } + writer.writeObjectValue("kubernetes_cluster_user", user2.kubernetesClusterUser, serializeUser2_kubernetes_cluster_user); + writer.writeAdditionalData(user2.additionalData); +} +/** + * Serializes information the current object + * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. + * @param User2_kubernetes_cluster_user The instance to serialize from. + * @param writer Serialization writer to use to serialize this model + */ +// @ts-ignore +export function serializeUser2_kubernetes_cluster_user(writer: SerializationWriter, user2_kubernetes_cluster_user: Partial | undefined | null = {}, isSerializingDerivedType: boolean = false) : void { + if (!user2_kubernetes_cluster_user || isSerializingDerivedType) { return; } + writer.writeCollectionOfPrimitiveValues("groups", user2_kubernetes_cluster_user.groups); + writer.writeStringValue("username", user2_kubernetes_cluster_user.username); + writer.writeAdditionalData(user2_kubernetes_cluster_user.additionalData); +} /** * Serializes information the current object * @param isSerializingDerivedType A boolean indicating whether the serialization is for a derived type. @@ -54360,6 +57284,60 @@ export function serializeVpc_peering_updatable(writer: SerializationWriter, vpc_ writer.writeStringValue("name", vpc_peering_updatable.name); writer.writeAdditionalData(vpc_peering_updatable.additionalData); } +export type Session_policy_action = (typeof Session_policy_actionObject)[keyof typeof Session_policy_actionObject]; +/** + * SessionPolicyRule applies an action to a tool or version-pinned toolbelt.action must be allow, ask, or deny. match optionally narrows the rule tocalls with matching arguments. + */ +export interface Session_policy_rule extends Parsable { + /** + * SessionPolicyAction is the disposition applied to a tool call. Lowercasevalues are canonical so ProtoJSON matches the public REST vocabulary; theprefixed aliases preserve compatibility for existing protobuf clients. + */ + action?: Session_policy_action | null; + /** + * The match property + */ + match?: Session_policy_rule_match | null; + /** + * The tool property + */ + tool?: string | null; +} +export interface Session_policy_rule_match extends AdditionalDataHolder, Parsable { +} +/** + * SessionPolicySpec is the Gateway-relevant subset of a session's permissionpolicy. Filesystem and network policy remain enforced by the sandbox. + */ +export interface Session_policy_spec extends Parsable { + /** + * SessionPolicyAction is the disposition applied to a tool call. Lowercasevalues are canonical so ProtoJSON matches the public REST vocabulary; theprefixed aliases preserve compatibility for existing protobuf clients. + */ + defaultAction?: Session_policy_action | null; + /** + * The rules property + */ + rules?: Session_policy_rule[] | null; +} +export interface Session_tool_reference extends Parsable { + /** + * The kind property + */ + kind?: Session_tool_reference_kind | null; + /** + * The name property + */ + name?: string | null; + /** + * The version property + */ + version?: string | null; +} +export type Session_tool_reference_kind = (typeof Session_tool_reference_kindObject)[keyof typeof Session_tool_reference_kindObject]; +export interface Session_tool_selection extends Parsable { + /** + * The references property + */ + references?: Session_tool_reference[] | null; +} export interface Settings extends AdditionalDataHolder, Parsable { /** * The plan_downgrades property @@ -54870,6 +57848,338 @@ export interface Timescaledb_advanced_config extends AdditionalDataHolder, Parsa */ maxBackgroundWorkers?: number | null; } +export interface Tool extends Parsable { + /** + * The annotations property + */ + annotations?: Tool_annotations | null; + /** + * The description property + */ + description?: string | null; + /** + * The inputSchema property + */ + inputSchema?: Tool_inputSchema | null; + /** + * The name property + */ + name?: string | null; + /** + * The outputSchema property + */ + outputSchema?: Tool_outputSchema | null; + /** + * The parallelizable property + */ + parallelizable?: boolean | null; + /** + * The streamingSafe property + */ + streamingSafe?: boolean | null; + /** + * The title property + */ + title?: string | null; + /** + * The toolkitId property + */ + toolkitId?: string | null; + /** + * tool_slug is the provider-qualified, stable tool identifier"_". Pass this value back verbatim to the toolbeltadd/remove endpoints; clients should treat it as opaque rather thanreconstructing it from toolkit_id and name. + */ + toolSlug?: string | null; + /** + * The version property + */ + version?: string | null; +} +export interface Tool_annotations extends Parsable { + /** + * The destructiveHint property + */ + destructiveHint?: boolean | null; + /** + * The idempotentHint property + */ + idempotentHint?: boolean | null; + /** + * The openWorldHint property + */ + openWorldHint?: boolean | null; + /** + * The readOnlyHint property + */ + readOnlyHint?: boolean | null; + /** + * The title property + */ + title?: string | null; +} +export interface Tool_definition extends Parsable { + /** + * The annotations property + */ + annotations?: Tool_annotations | null; + /** + * The auth property + */ + auth?: Auth_spec | null; + /** + * The classification property + */ + classification?: Classification | null; + /** + * The description property + */ + description?: string | null; + /** + * The execution property + */ + execution?: Execution_spec | null; + /** + * The flipperName property + */ + flipperName?: string | null; + /** + * The hooks property + */ + hooks?: Hook_spec | null; + /** + * The inputSchema property + */ + inputSchema?: Tool_definition_inputSchema | null; + /** + * The name property + */ + name?: string | null; + /** + * The outputSchema property + */ + outputSchema?: Tool_definition_outputSchema | null; + /** + * The parallelizable property + */ + parallelizable?: boolean | null; + /** + * The policy property + */ + policy?: Policy_spec | null; + /** + * The reliability property + */ + reliability?: Reliability_spec | null; + /** + * The schemaVersion property + */ + schemaVersion?: string | null; + /** + * The status property + */ + status?: string | null; + /** + * The streamingSafe property + */ + streamingSafe?: boolean | null; + /** + * The tags property + */ + tags?: string[] | null; + /** + * The title property + */ + title?: string | null; + /** + * The toolId property + */ + toolId?: string | null; + /** + * The toolkitId property + */ + toolkitId?: string | null; + /** + * tool_slug is the provider-qualified, stable tool identifier"_". Pass this value back verbatim to the toolbeltadd/remove endpoints; clients should treat it as opaque. + */ + toolSlug?: string | null; + /** + * The transform property + */ + transform?: Transform_spec | null; + /** + * The version property + */ + version?: string | null; +} +export interface Tool_definition_inputSchema extends AdditionalDataHolder, Parsable { +} +export interface Tool_definition_outputSchema extends AdditionalDataHolder, Parsable { +} +export interface Tool_inputSchema extends AdditionalDataHolder, Parsable { +} +export interface Tool_outputSchema extends AdditionalDataHolder, Parsable { +} +export interface Toolbelt extends Parsable { + /** + * The created_at property + */ + createdAt?: Date | null; + /** + * The description property + */ + description?: string | null; + /** + * The display_name property + */ + displayName?: string | null; + /** + * The name property + */ + name?: string | null; + /** + * A reference pinned to this immutable toolbelt version. + */ + reference?: string | null; + /** + * An unversioned reference to the latest active version. + */ + referenceLatest?: string | null; + /** + * The status property + */ + status?: Toolbelt_status | null; + /** + * The tool_count property + */ + toolCount?: number | null; + /** + * The tools property + */ + tools?: string[] | null; + /** + * The updated_at property + */ + updatedAt?: Date | null; + /** + * The version property + */ + version?: string | null; +} +export interface Toolbelt_create extends Parsable { + /** + * The description property + */ + description?: string | null; + /** + * The display_name property + */ + displayName?: string | null; + /** + * The name property + */ + name?: string | null; + /** + * The tools property + */ + tools?: string[] | null; + /** + * The version property + */ + version?: string | null; +} +export interface Toolbelt_response extends Parsable { + /** + * The toolbelt property + */ + toolbelt?: Toolbelt | null; +} +export type Toolbelt_status = (typeof Toolbelt_statusObject)[keyof typeof Toolbelt_statusObject]; +export interface Toolbelt_summary extends Parsable { + /** + * The description property + */ + description?: string | null; + /** + * The display_name property + */ + displayName?: string | null; + /** + * The latest_version property + */ + latestVersion?: string | null; + /** + * The name property + */ + name?: string | null; + /** + * The reference_latest property + */ + referenceLatest?: string | null; + /** + * The status property + */ + status?: Toolbelt_summary_status | null; + /** + * The tool_count property + */ + toolCount?: number | null; + /** + * The updated_at property + */ + updatedAt?: Date | null; + /** + * The version_count property + */ + versionCount?: number | null; +} +export type Toolbelt_summary_status = (typeof Toolbelt_summary_statusObject)[keyof typeof Toolbelt_summary_statusObject]; +export interface Toolbelt_tools extends Parsable { + /** + * The tools property + */ + tools?: string[] | null; +} +export interface Toolbelts_response extends Parsable { + /** + * The pagination property + */ + pagination?: Pagination | null; + /** + * The toolbelts property + */ + toolbelts?: Toolbelt_summary[] | null; +} +export interface Toolkit extends Parsable { + /** + * The description property + */ + description?: string | null; + /** + * The id property + */ + id?: string | null; + /** + * The name property + */ + name?: string | null; +} +export interface Transform_spec extends Parsable { + /** + * The input property + */ + input?: Transform_spec_input | null; + /** + * The language property + */ + language?: string | null; + /** + * The output property + */ + output?: Transform_spec_output | null; +} +export interface Transform_spec_input extends AdditionalDataHolder, Parsable { +} +export interface Transform_spec_output extends AdditionalDataHolder, Parsable { +} export interface Trigger_info extends AdditionalDataHolder, Parsable { /** * UTC time string. @@ -54918,6 +58228,24 @@ export interface Trigger_info_scheduled_runs extends AdditionalDataHolder, Parsa */ nextRunAt?: string | null; } +export interface Update_connection_parameters_request extends Parsable { + /** + * The connection_parameters property + */ + connectionParameters?: Update_connection_parameters_request_connection_parameters | null; + /** + * The id property + */ + id?: string | null; +} +export interface Update_connection_parameters_request_connection_parameters extends AdditionalDataHolder, Parsable { +} +export interface Update_connection_parameters_response extends Parsable { + /** + * -----------------------------------------------------------------------------OAuth connection resources-----------------------------------------------------------------------------OAuthConnection is the public, team-scoped connection metadata returned tothe UI. It deliberately excludes the team ID, Secrets Manager assignment,actor identifiers, poll URL, and authorization handle. + */ + connection?: Oauth_connection | null; +} export interface Update_endpoint extends AdditionalDataHolder, Parsable { /** * The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided. @@ -54948,21 +58276,64 @@ export interface Update_trigger extends AdditionalDataHolder, Parsable { */ scheduledDetails?: Scheduled_details | null; } -export interface User extends AdditionalDataHolder, Parsable { +export interface Usage_meter extends Parsable { /** - * The kubernetes_cluster_user property + * The quantitySource property */ - kubernetesClusterUser?: User_kubernetes_cluster_user | null; + quantitySource?: string | null; + /** + * The sku property + */ + sku?: string | null; + /** + * The unit property + */ + unit?: string | null; } -export interface User_kubernetes_cluster_user extends AdditionalDataHolder, Parsable { +export interface Usage_spec extends Parsable { /** - * A list of in-cluster groups that the user belongs to. + * When usage metadata is present, false prevents billing. Omitting usagemetadata leaves consumers' legacy billing classification unchanged. */ - groups?: string[] | null; + billable?: boolean | null; /** - * The username for the cluster admin user. + * The meters property */ - username?: string | null; + meters?: Usage_meter[] | null; +} +/** + * User is a derived, team-scoped view across sessions and OAuth connections. + */ +export interface User extends Parsable { + /** + * The connections property + */ + connections?: Oauth_connection[] | null; + /** + * The sessions property + */ + sessions?: User_session[] | null; + /** + * The user_id property + */ + userId?: string | null; +} +export interface User_session extends Parsable { + /** + * The created_at property + */ + createdAt?: Date | null; + /** + * The name property + */ + name?: string | null; + /** + * The session_urn property + */ + sessionUrn?: string | null; + /** + * The updated_at property + */ + updatedAt?: Date | null; } export interface User_settings extends AdditionalDataHolder, Parsable { /** @@ -55022,6 +58393,22 @@ export interface User_settings_opensearch_acl extends AdditionalDataHolder, Pars permission?: User_settings_opensearch_acl_permission | null; } export type User_settings_opensearch_acl_permission = (typeof User_settings_opensearch_acl_permissionObject)[keyof typeof User_settings_opensearch_acl_permissionObject]; +export interface User2 extends AdditionalDataHolder, Parsable { + /** + * The kubernetes_cluster_user property + */ + kubernetesClusterUser?: User2_kubernetes_cluster_user | null; +} +export interface User2_kubernetes_cluster_user extends AdditionalDataHolder, Parsable { + /** + * A list of in-cluster groups that the user belongs to. + */ + groups?: string[] | null; + /** + * The username for the cluster admin user. + */ + username?: string | null; +} export interface Validate_registry extends AdditionalDataHolder, Parsable { /** * A globally unique name for the container registry. Must be lowercase and be composed only of numbers, letters and `-`, up to a limit of 63 characters. @@ -57930,6 +61317,18 @@ export const Scan_statusObject = { CSPM_NOT_ENABLED: "CSPM_NOT_ENABLED", SCAN_NOT_RUN: "SCAN_NOT_RUN", } as const; +/** + * SessionPolicyAction is the disposition applied to a tool call. Lowercasevalues are canonical so ProtoJSON matches the public REST vocabulary; theprefixed aliases preserve compatibility for existing protobuf clients. + */ +export const Session_policy_actionObject = { + Allow: "allow", + Ask: "ask", + Deny: "deny", +} as const; +export const Session_tool_reference_kindObject = { + SESSION_TOOL_REFERENCE_KIND_TOOL: "SESSION_TOOL_REFERENCE_KIND_TOOL", + SESSION_TOOL_REFERENCE_KIND_TOOLBELT: "SESSION_TOOL_REFERENCE_KIND_TOOLBELT", +} as const; /** * The type of resource that the snapshot originated from. */ @@ -57962,6 +61361,14 @@ export const Tags_resource_resources_resource_typeObject = { Volume: "volume", Volume_snapshot: "volume_snapshot", } as const; +export const Toolbelt_statusObject = { + Active: "active", + Deprecated: "deprecated", +} as const; +export const Toolbelt_summary_statusObject = { + Active: "active", + Deprecated: "deprecated", +} as const; /** * The role to assign to the invited user. The `owner` role cannot be assigned via invitation. */ diff --git a/src/dots/v2/actionGateway/connections/index.ts b/src/dots/v2/actionGateway/connections/index.ts new file mode 100644 index 000000000..8e61ee6f4 --- /dev/null +++ b/src/dots/v2/actionGateway/connections/index.ts @@ -0,0 +1,148 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createCreate_connection_responseFromDiscriminatorValue, createErrorEscapedFromDiscriminatorValue, createList_connections_responseFromDiscriminatorValue, serializeCreate_connection_request, serializeCreate_connection_response, type Create_connection_request, type Create_connection_response, type ErrorEscaped, type List_connections_response } from '../../../models/index.js'; +// @ts-ignore +import { ConnectionsItemRequestBuilderRequestsMetadata, type ConnectionsItemRequestBuilder } from './item/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/connections + */ +export interface ConnectionsRequestBuilder extends BaseRequestBuilder { + /** + * Gets an item from the ApiSdk.v2.actionGateway.connections.item collection + * @param id The connection UUID. + * @returns {ConnectionsItemRequestBuilder} + */ + byId(id: string) : ConnectionsItemRequestBuilder; + /** + * Lists OAuth connections owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Creates or begins authorization for an OAuth connection to an Action Gateway provider. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 400 status code + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 409 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + post(body: Create_connection_request, requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists OAuth connections owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; + /** + * Creates or begins authorization for an OAuth connection to an Action Gateway provider. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toPostRequestInformation(body: Create_connection_request, requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Lists OAuth connections owned by the authenticated team. + */ +export interface ConnectionsRequestBuilderGetQueryParameters { + /** + * Which 'page' of paginated results to return. + */ + page?: number; + /** + * Number of items returned per page + */ + perPage?: number; + /** + * Filter by provider name. + */ + provider?: string; + /** + * Field used to sort results. + */ + sort?: string; + /** + * Sort direction. + */ + sortDirection?: string; + /** + * Filter by connection status. + */ + status?: string; + /** + * Filter by end-user identifier. + */ + userId?: string; +} +/** + * Uri template for the request builder. + */ +export const ConnectionsRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/connections{?page*,per_page*,provider*,sort*,sort_direction*,status*,user_id*}"; +/** + * Mapper for query parameters from symbol name to serialization name represented as a constant. + */ +const ConnectionsRequestBuilderGetQueryParametersMapper: Record = { + "perPage": "per_page", + "sortDirection": "sort_direction", + "userId": "user_id", +}; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const ConnectionsRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + byId: { + requestsMetadata: ConnectionsItemRequestBuilderRequestsMetadata, + pathParametersMappings: ["id"], + }, +}; +/** + * Metadata for all the requests in the request builder. + */ +export const ConnectionsRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: ConnectionsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createList_connections_responseFromDiscriminatorValue, + queryParametersMapper: ConnectionsRequestBuilderGetQueryParametersMapper, + }, + post: { + uriTemplate: ConnectionsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 400: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 409: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createCreate_connection_responseFromDiscriminatorValue, + requestBodyContentType: "application/json", + requestBodySerializer: serializeCreate_connection_request, + requestInformationContentSetMethod: "setContentFromParsable", + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/connections/item/index.ts b/src/dots/v2/actionGateway/connections/item/index.ts new file mode 100644 index 000000000..1acd046ee --- /dev/null +++ b/src/dots/v2/actionGateway/connections/item/index.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createDelete_connection_responseFromDiscriminatorValue, createErrorEscapedFromDiscriminatorValue, createGet_connection_responseFromDiscriminatorValue, createUpdate_connection_parameters_responseFromDiscriminatorValue, serializeUpdate_connection_parameters_request, serializeUpdate_connection_parameters_response, type Delete_connection_response, type ErrorEscaped, type Get_connection_response, type Update_connection_parameters_request, type Update_connection_parameters_response } from '../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/connections/{id} + */ +export interface ConnectionsItemRequestBuilder extends BaseRequestBuilder { + /** + * Revokes and deletes an OAuth connection owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + delete(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Retrieves an OAuth connection owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Updates non-sensitive connection parameters for an OAuth connection. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 400 status code + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + patch(body: Update_connection_parameters_request, requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Revokes and deletes an OAuth connection owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toDeleteRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; + /** + * Retrieves an OAuth connection owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; + /** + * Updates non-sensitive connection parameters for an OAuth connection. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toPatchRequestInformation(body: Update_connection_parameters_request, requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const ConnectionsItemRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/connections/{id}"; +/** + * Metadata for all the requests in the request builder. + */ +export const ConnectionsItemRequestBuilderRequestsMetadata: RequestsMetadata = { + delete: { + uriTemplate: ConnectionsItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createDelete_connection_responseFromDiscriminatorValue, + }, + get: { + uriTemplate: ConnectionsItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createGet_connection_responseFromDiscriminatorValue, + }, + patch: { + uriTemplate: ConnectionsItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 400: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createUpdate_connection_parameters_responseFromDiscriminatorValue, + requestBodyContentType: "application/json", + requestBodySerializer: serializeUpdate_connection_parameters_request, + requestInformationContentSetMethod: "setContentFromParsable", + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/index.ts b/src/dots/v2/actionGateway/index.ts new file mode 100644 index 000000000..00a87e710 --- /dev/null +++ b/src/dots/v2/actionGateway/index.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { ConnectionsRequestBuilderNavigationMetadata, ConnectionsRequestBuilderRequestsMetadata, type ConnectionsRequestBuilder } from './connections/index.js'; +// @ts-ignore +import { SessionsRequestBuilderNavigationMetadata, SessionsRequestBuilderRequestsMetadata, type SessionsRequestBuilder } from './sessions/index.js'; +// @ts-ignore +import { ToolbeltsRequestBuilderNavigationMetadata, ToolbeltsRequestBuilderRequestsMetadata, type ToolbeltsRequestBuilder } from './toolbelts/index.js'; +// @ts-ignore +import { ToolsRequestBuilderNavigationMetadata, ToolsRequestBuilderRequestsMetadata, type ToolsRequestBuilder } from './tools/index.js'; +// @ts-ignore +import { type UsersRequestBuilder, UsersRequestBuilderNavigationMetadata, UsersRequestBuilderRequestsMetadata } from './users/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway + */ +export interface ActionGatewayRequestBuilder extends BaseRequestBuilder { + /** + * The connections property + */ + get connections(): ConnectionsRequestBuilder; + /** + * The sessions property + */ + get sessions(): SessionsRequestBuilder; + /** + * The toolbelts property + */ + get toolbelts(): ToolbeltsRequestBuilder; + /** + * The tools property + */ + get tools(): ToolsRequestBuilder; + /** + * The users property + */ + get users(): UsersRequestBuilder; +} +/** + * Uri template for the request builder. + */ +export const ActionGatewayRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway"; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const ActionGatewayRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + connections: { + requestsMetadata: ConnectionsRequestBuilderRequestsMetadata, + navigationMetadata: ConnectionsRequestBuilderNavigationMetadata, + }, + sessions: { + requestsMetadata: SessionsRequestBuilderRequestsMetadata, + navigationMetadata: SessionsRequestBuilderNavigationMetadata, + }, + toolbelts: { + requestsMetadata: ToolbeltsRequestBuilderRequestsMetadata, + navigationMetadata: ToolbeltsRequestBuilderNavigationMetadata, + }, + tools: { + requestsMetadata: ToolsRequestBuilderRequestsMetadata, + navigationMetadata: ToolsRequestBuilderNavigationMetadata, + }, + users: { + requestsMetadata: UsersRequestBuilderRequestsMetadata, + navigationMetadata: UsersRequestBuilderNavigationMetadata, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/sessions/index.ts b/src/dots/v2/actionGateway/sessions/index.ts new file mode 100644 index 000000000..4dca9b7e5 --- /dev/null +++ b/src/dots/v2/actionGateway/sessions/index.ts @@ -0,0 +1,129 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createCreate_session_responseFromDiscriminatorValue, createErrorEscapedFromDiscriminatorValue, createList_sessions_responseFromDiscriminatorValue, serializeCreate_session_request, serializeCreate_session_response, type Create_session_request, type Create_session_response, type ErrorEscaped, type List_sessions_response } from '../../../models/index.js'; +// @ts-ignore +import { type WithSession_urnItemRequestBuilder, WithSession_urnItemRequestBuilderRequestsMetadata } from './item/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/sessions + */ +export interface SessionsRequestBuilder extends BaseRequestBuilder { + /** + * Gets an item from the ApiSdk.v2.actionGateway.sessions.item collection + * @param session_urn The URL-encoded managed agents session URN. + * @returns {WithSession_urnItemRequestBuilder} + */ + bySession_urn(session_urn: string) : WithSession_urnItemRequestBuilder; + /** + * Lists Action Gateway sessions owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Creates a session with a tool selection, invocation policy, and optional direct-tool preload configuration. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 400 status code + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + post(body: Create_session_request, requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists Action Gateway sessions owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; + /** + * Creates a session with a tool selection, invocation policy, and optional direct-tool preload configuration. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toPostRequestInformation(body: Create_session_request, requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Lists Action Gateway sessions owned by the authenticated team. + */ +export interface SessionsRequestBuilderGetQueryParameters { + /** + * Filter sessions by actor identifier. + */ + endUserId?: string; + /** + * Which 'page' of paginated results to return. + */ + page?: number; + /** + * Number of items returned per page + */ + perPage?: number; +} +/** + * Uri template for the request builder. + */ +export const SessionsRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/sessions{?end_user_id*,page*,per_page*}"; +/** + * Mapper for query parameters from symbol name to serialization name represented as a constant. + */ +const SessionsRequestBuilderGetQueryParametersMapper: Record = { + "endUserId": "end_user_id", + "perPage": "per_page", +}; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const SessionsRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + bySession_urn: { + requestsMetadata: WithSession_urnItemRequestBuilderRequestsMetadata, + pathParametersMappings: ["session_urn"], + }, +}; +/** + * Metadata for all the requests in the request builder. + */ +export const SessionsRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: SessionsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createList_sessions_responseFromDiscriminatorValue, + queryParametersMapper: SessionsRequestBuilderGetQueryParametersMapper, + }, + post: { + uriTemplate: SessionsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 400: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createCreate_session_responseFromDiscriminatorValue, + requestBodyContentType: "application/json", + requestBodySerializer: serializeCreate_session_request, + requestInformationContentSetMethod: "setContentFromParsable", + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/sessions/item/index.ts b/src/dots/v2/actionGateway/sessions/item/index.ts new file mode 100644 index 000000000..d3586f74a --- /dev/null +++ b/src/dots/v2/actionGateway/sessions/item/index.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createDelete_session_responseFromDiscriminatorValue, createErrorEscapedFromDiscriminatorValue, type Delete_session_response, type ErrorEscaped } from '../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/sessions/{session_urn} + */ +export interface WithSession_urnItemRequestBuilder extends BaseRequestBuilder { + /** + * Deletes an Action Gateway session owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + delete(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Deletes an Action Gateway session owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toDeleteRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const WithSession_urnItemRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/sessions/{session_urn}"; +/** + * Metadata for all the requests in the request builder. + */ +export const WithSession_urnItemRequestBuilderRequestsMetadata: RequestsMetadata = { + delete: { + uriTemplate: WithSession_urnItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createDelete_session_responseFromDiscriminatorValue, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/toolbelts/index.ts b/src/dots/v2/actionGateway/toolbelts/index.ts new file mode 100644 index 000000000..401941fbc --- /dev/null +++ b/src/dots/v2/actionGateway/toolbelts/index.ts @@ -0,0 +1,137 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createToolbelt_responseFromDiscriminatorValue, createToolbelts_responseFromDiscriminatorValue, serializeToolbelt_create, serializeToolbelt_response, type ErrorEscaped, type Toolbelt_create, type Toolbelt_response, type Toolbelts_response } from '../../../models/index.js'; +// @ts-ignore +import { type WithNameItemRequestBuilder, WithNameItemRequestBuilderNavigationMetadata, WithNameItemRequestBuilderRequestsMetadata } from './item/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +export type GetStatusQueryParameterType = (typeof GetStatusQueryParameterTypeObject)[keyof typeof GetStatusQueryParameterTypeObject]; +/** + * Builds and executes requests for operations under /v2/action-gateway/toolbelts + */ +export interface ToolbeltsRequestBuilder extends BaseRequestBuilder { + /** + * Gets an item from the ApiSdk.v2.actionGateway.toolbelts.item collection + * @param name The natural key identifying the toolbelt. + * @returns {WithNameItemRequestBuilder} + */ + byName(name: string) : WithNameItemRequestBuilder; + /** + * Lists the latest version of each toolbelt owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Creates a versioned collection of provider-qualified Action Gateway tool names. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 400 status code + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 409 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + post(body: Toolbelt_create, requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists the latest version of each toolbelt owned by the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; + /** + * Creates a versioned collection of provider-qualified Action Gateway tool names. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toPostRequestInformation(body: Toolbelt_create, requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Lists the latest version of each toolbelt owned by the authenticated team. + */ +export interface ToolbeltsRequestBuilderGetQueryParameters { + /** + * Which 'page' of paginated results to return. + */ + page?: number; + /** + * Number of items returned per page + */ + perPage?: number; + /** + * Filter toolbelts by status. + */ + status?: GetStatusQueryParameterType; +} +/** + * Uri template for the request builder. + */ +export const ToolbeltsRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/toolbelts{?page*,per_page*,status*}"; +export const GetStatusQueryParameterTypeObject = { + Active: "active", + Deprecated: "deprecated", + All: "all", +} as const; +/** + * Mapper for query parameters from symbol name to serialization name represented as a constant. + */ +const ToolbeltsRequestBuilderGetQueryParametersMapper: Record = { + "perPage": "per_page", +}; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const ToolbeltsRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + byName: { + requestsMetadata: WithNameItemRequestBuilderRequestsMetadata, + navigationMetadata: WithNameItemRequestBuilderNavigationMetadata, + pathParametersMappings: ["name"], + }, +}; +/** + * Metadata for all the requests in the request builder. + */ +export const ToolbeltsRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: ToolbeltsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createToolbelts_responseFromDiscriminatorValue, + queryParametersMapper: ToolbeltsRequestBuilderGetQueryParametersMapper, + }, + post: { + uriTemplate: ToolbeltsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 400: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 409: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createToolbelt_responseFromDiscriminatorValue, + requestBodyContentType: "application/json", + requestBodySerializer: serializeToolbelt_create, + requestInformationContentSetMethod: "setContentFromParsable", + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/toolbelts/item/index.ts b/src/dots/v2/actionGateway/toolbelts/item/index.ts new file mode 100644 index 000000000..e7c8d3452 --- /dev/null +++ b/src/dots/v2/actionGateway/toolbelts/item/index.ts @@ -0,0 +1,107 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createToolbelt_responseFromDiscriminatorValue, type ErrorEscaped, type Toolbelt_response } from '../../../../models/index.js'; +// @ts-ignore +import { ToolsRequestBuilderNavigationMetadata, type ToolsRequestBuilder } from './tools/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/toolbelts/{name} + */ +export interface WithNameItemRequestBuilder extends BaseRequestBuilder { + /** + * The tools property + */ + get tools(): ToolsRequestBuilder; + /** + * Deprecates the latest active version of a toolbelt. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + delete(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Retrieves the latest active version or a specified immutable version of a toolbelt. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Deprecates the latest active version of a toolbelt. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toDeleteRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; + /** + * Retrieves the latest active version or a specified immutable version of a toolbelt. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Retrieves the latest active version or a specified immutable version of a toolbelt. + */ +export interface WithNameItemRequestBuilderGetQueryParameters { + /** + * An immutable numeric toolbelt version. Omit to retrieve the latest active version. + */ + version?: string; +} +/** + * Uri template for the request builder. + */ +export const WithNameItemRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/toolbelts/{name}{?version*}"; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const WithNameItemRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + tools: { + navigationMetadata: ToolsRequestBuilderNavigationMetadata, + }, +}; +/** + * Metadata for all the requests in the request builder. + */ +export const WithNameItemRequestBuilderRequestsMetadata: RequestsMetadata = { + delete: { + uriTemplate: WithNameItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createToolbelt_responseFromDiscriminatorValue, + }, + get: { + uriTemplate: WithNameItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createToolbelt_responseFromDiscriminatorValue, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/toolbelts/item/tools/add/index.ts b/src/dots/v2/actionGateway/toolbelts/item/tools/add/index.ts new file mode 100644 index 000000000..e3e61cd9e --- /dev/null +++ b/src/dots/v2/actionGateway/toolbelts/item/tools/add/index.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createToolbelt_responseFromDiscriminatorValue, serializeToolbelt_response, serializeToolbelt_tools, type ErrorEscaped, type Toolbelt_response, type Toolbelt_tools } from '../../../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/toolbelts/{name}/tools/add + */ +export interface AddRequestBuilder extends BaseRequestBuilder { + /** + * Adds provider-qualified tool names and creates a new immutable toolbelt version. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 400 status code + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + post(body: Toolbelt_tools, requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Adds provider-qualified tool names and creates a new immutable toolbelt version. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toPostRequestInformation(body: Toolbelt_tools, requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const AddRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/toolbelts/{name}/tools/add"; +/** + * Metadata for all the requests in the request builder. + */ +export const AddRequestBuilderRequestsMetadata: RequestsMetadata = { + post: { + uriTemplate: AddRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 400: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createToolbelt_responseFromDiscriminatorValue, + requestBodyContentType: "application/json", + requestBodySerializer: serializeToolbelt_tools, + requestInformationContentSetMethod: "setContentFromParsable", + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/toolbelts/item/tools/index.ts b/src/dots/v2/actionGateway/toolbelts/item/tools/index.ts new file mode 100644 index 000000000..b3aea797b --- /dev/null +++ b/src/dots/v2/actionGateway/toolbelts/item/tools/index.ts @@ -0,0 +1,40 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { AddRequestBuilderRequestsMetadata, type AddRequestBuilder } from './add/index.js'; +// @ts-ignore +import { RemoveRequestBuilderRequestsMetadata, type RemoveRequestBuilder } from './remove/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/toolbelts/{name}/tools + */ +export interface ToolsRequestBuilder extends BaseRequestBuilder { + /** + * The add property + */ + get add(): AddRequestBuilder; + /** + * The remove property + */ + get remove(): RemoveRequestBuilder; +} +/** + * Uri template for the request builder. + */ +export const ToolsRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/toolbelts/{name}/tools"; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const ToolsRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + add: { + requestsMetadata: AddRequestBuilderRequestsMetadata, + }, + remove: { + requestsMetadata: RemoveRequestBuilderRequestsMetadata, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/toolbelts/item/tools/remove/index.ts b/src/dots/v2/actionGateway/toolbelts/item/tools/remove/index.ts new file mode 100644 index 000000000..909207342 --- /dev/null +++ b/src/dots/v2/actionGateway/toolbelts/item/tools/remove/index.ts @@ -0,0 +1,61 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createToolbelt_responseFromDiscriminatorValue, serializeToolbelt_response, serializeToolbelt_tools, type ErrorEscaped, type Toolbelt_response, type Toolbelt_tools } from '../../../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/toolbelts/{name}/tools/remove + */ +export interface RemoveRequestBuilder extends BaseRequestBuilder { + /** + * Removes tool names and creates a new immutable toolbelt version. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 400 status code + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + post(body: Toolbelt_tools, requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Removes tool names and creates a new immutable toolbelt version. + * @param body The request body + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toPostRequestInformation(body: Toolbelt_tools, requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const RemoveRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/toolbelts/{name}/tools/remove"; +/** + * Metadata for all the requests in the request builder. + */ +export const RemoveRequestBuilderRequestsMetadata: RequestsMetadata = { + post: { + uriTemplate: RemoveRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 400: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createToolbelt_responseFromDiscriminatorValue, + requestBodyContentType: "application/json", + requestBodySerializer: serializeToolbelt_tools, + requestInformationContentSetMethod: "setContentFromParsable", + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/tools/index.ts b/src/dots/v2/actionGateway/tools/index.ts new file mode 100644 index 000000000..9c130612a --- /dev/null +++ b/src/dots/v2/actionGateway/tools/index.ts @@ -0,0 +1,112 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createList_tools_responseFromDiscriminatorValue, type ErrorEscaped, type List_tools_response } from '../../../models/index.js'; +// @ts-ignore +import { type WithNameItemRequestBuilder, WithNameItemRequestBuilderNavigationMetadata } from './item/index.js'; +// @ts-ignore +import { ProvidersRequestBuilderRequestsMetadata, type ProvidersRequestBuilder } from './providers/index.js'; +// @ts-ignore +import { ToolkitsRequestBuilderRequestsMetadata, type ToolkitsRequestBuilder } from './toolkits/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/tools + */ +export interface ToolsRequestBuilder extends BaseRequestBuilder { + /** + * The providers property + */ + get providers(): ProvidersRequestBuilder; + /** + * The toolkits property + */ + get toolkits(): ToolkitsRequestBuilder; + /** + * Gets an item from the ApiSdk.v2.actionGateway.tools.item collection + * @param name The provider-qualified tool name. + * @returns {WithNameItemRequestBuilder} + */ + byName(name: string) : WithNameItemRequestBuilder; + /** + * Lists active Action Gateway tools visible to the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists active Action Gateway tools visible to the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Lists active Action Gateway tools visible to the authenticated team. + */ +export interface ToolsRequestBuilderGetQueryParameters { + /** + * Which 'page' of paginated results to return. + */ + page?: number; + /** + * Number of items returned per page + */ + perPage?: number; + /** + * Filter tools by toolkit identifier. + */ + toolkitId?: string; +} +/** + * Uri template for the request builder. + */ +export const ToolsRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/tools{?page*,per_page*,toolkit_id*}"; +/** + * Mapper for query parameters from symbol name to serialization name represented as a constant. + */ +const ToolsRequestBuilderGetQueryParametersMapper: Record = { + "perPage": "per_page", + "toolkitId": "toolkit_id", +}; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const ToolsRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + byName: { + navigationMetadata: WithNameItemRequestBuilderNavigationMetadata, + pathParametersMappings: ["name"], + }, + providers: { + requestsMetadata: ProvidersRequestBuilderRequestsMetadata, + }, + toolkits: { + requestsMetadata: ToolkitsRequestBuilderRequestsMetadata, + }, +}; +/** + * Metadata for all the requests in the request builder. + */ +export const ToolsRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: ToolsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createList_tools_responseFromDiscriminatorValue, + queryParametersMapper: ToolsRequestBuilderGetQueryParametersMapper, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/tools/item/definition/index.ts b/src/dots/v2/actionGateway/tools/item/definition/index.ts new file mode 100644 index 000000000..c917192ea --- /dev/null +++ b/src/dots/v2/actionGateway/tools/item/definition/index.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createTool_definitionFromDiscriminatorValue, type ErrorEscaped, type Tool_definition } from '../../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/tools/{name}/definition + */ +export interface DefinitionRequestBuilder extends BaseRequestBuilder { + /** + * Retrieves the executable definition for an active Action Gateway tool. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Retrieves the executable definition for an active Action Gateway tool. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Retrieves the executable definition for an active Action Gateway tool. + */ +export interface DefinitionRequestBuilderGetQueryParameters { + /** + * The toolkit identifier used to disambiguate a bare tool name. + */ + toolkitId?: string; + /** + * The tool version. Omit to retrieve the current version. + */ + version?: string; +} +/** + * Uri template for the request builder. + */ +export const DefinitionRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/tools/{name}/definition{?toolkit_id*,version*}"; +/** + * Mapper for query parameters from symbol name to serialization name represented as a constant. + */ +const DefinitionRequestBuilderGetQueryParametersMapper: Record = { + "toolkitId": "toolkit_id", +}; +/** + * Metadata for all the requests in the request builder. + */ +export const DefinitionRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: DefinitionRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createTool_definitionFromDiscriminatorValue, + queryParametersMapper: DefinitionRequestBuilderGetQueryParametersMapper, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/tools/item/index.ts b/src/dots/v2/actionGateway/tools/item/index.ts new file mode 100644 index 000000000..1c9b341bc --- /dev/null +++ b/src/dots/v2/actionGateway/tools/item/index.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { DefinitionRequestBuilderRequestsMetadata, type DefinitionRequestBuilder } from './definition/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/tools/{name} + */ +export interface WithNameItemRequestBuilder extends BaseRequestBuilder { + /** + * The definition property + */ + get definition(): DefinitionRequestBuilder; +} +/** + * Uri template for the request builder. + */ +export const WithNameItemRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/tools/{name}"; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const WithNameItemRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + definition: { + requestsMetadata: DefinitionRequestBuilderRequestsMetadata, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/tools/providers/index.ts b/src/dots/v2/actionGateway/tools/providers/index.ts new file mode 100644 index 000000000..8081b5ee8 --- /dev/null +++ b/src/dots/v2/actionGateway/tools/providers/index.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createList_providers_responseFromDiscriminatorValue, type ErrorEscaped, type List_providers_response } from '../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/tools/providers + */ +export interface ProvidersRequestBuilder extends BaseRequestBuilder { + /** + * Lists Action Gateway providers and their connection requirements. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists Action Gateway providers and their connection requirements. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const ProvidersRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/tools/providers"; +/** + * Metadata for all the requests in the request builder. + */ +export const ProvidersRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: ProvidersRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createList_providers_responseFromDiscriminatorValue, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/tools/toolkits/index.ts b/src/dots/v2/actionGateway/tools/toolkits/index.ts new file mode 100644 index 000000000..2baf79998 --- /dev/null +++ b/src/dots/v2/actionGateway/tools/toolkits/index.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createList_toolkits_responseFromDiscriminatorValue, type ErrorEscaped, type List_toolkits_response } from '../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/tools/toolkits + */ +export interface ToolkitsRequestBuilder extends BaseRequestBuilder { + /** + * Lists the toolkits that group Action Gateway tools. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists the toolkits that group Action Gateway tools. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const ToolkitsRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/tools/toolkits"; +/** + * Metadata for all the requests in the request builder. + */ +export const ToolkitsRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: ToolkitsRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createList_toolkits_responseFromDiscriminatorValue, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/users/index.ts b/src/dots/v2/actionGateway/users/index.ts new file mode 100644 index 000000000..e6dc7fd41 --- /dev/null +++ b/src/dots/v2/actionGateway/users/index.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createList_users_responseFromDiscriminatorValue, type ErrorEscaped, type List_users_response } from '../../../models/index.js'; +// @ts-ignore +import { type WithUser_ItemRequestBuilder, WithUser_ItemRequestBuilderRequestsMetadata } from './item/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/users + */ +export interface UsersRequestBuilder extends BaseRequestBuilder { + /** + * Gets an item from the ApiSdk.v2.actionGateway.users.item collection + * @param user_id The end-user identifier. + * @returns {WithUser_ItemRequestBuilder} + */ + byUser_id(user_id: string) : WithUser_ItemRequestBuilder; + /** + * Lists end-user identifiers derived from sessions and OAuth connections for the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Lists end-user identifiers derived from sessions and OAuth connections for the authenticated team. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Lists end-user identifiers derived from sessions and OAuth connections for the authenticated team. + */ +export interface UsersRequestBuilderGetQueryParameters { + /** + * Which 'page' of paginated results to return. + */ + page?: number; + /** + * Number of items returned per page + */ + perPage?: number; +} +/** + * Uri template for the request builder. + */ +export const UsersRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/users{?page*,per_page*}"; +/** + * Mapper for query parameters from symbol name to serialization name represented as a constant. + */ +const UsersRequestBuilderGetQueryParametersMapper: Record = { + "perPage": "per_page", +}; +/** + * Metadata for all the navigation properties in the request builder. + */ +export const UsersRequestBuilderNavigationMetadata: Record, NavigationMetadata> = { + byUser_id: { + requestsMetadata: WithUser_ItemRequestBuilderRequestsMetadata, + pathParametersMappings: ["user_id"], + }, +}; +/** + * Metadata for all the requests in the request builder. + */ +export const UsersRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: UsersRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createList_users_responseFromDiscriminatorValue, + queryParametersMapper: UsersRequestBuilderGetQueryParametersMapper, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/actionGateway/users/item/index.ts b/src/dots/v2/actionGateway/users/item/index.ts new file mode 100644 index 000000000..29eb0d911 --- /dev/null +++ b/src/dots/v2/actionGateway/users/item/index.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +// Generated by Microsoft Kiota +// @ts-ignore +import { createErrorEscapedFromDiscriminatorValue, createGet_user_responseFromDiscriminatorValue, type ErrorEscaped, type Get_user_response } from '../../../../models/index.js'; +// @ts-ignore +import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions'; + +/** + * Builds and executes requests for operations under /v2/action-gateway/users/{user_id} + */ +export interface WithUser_ItemRequestBuilder extends BaseRequestBuilder { + /** + * Retrieves a derived end-user view containing its sessions and OAuth connections. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {Promise} + * @throws {ErrorEscaped} error when the service returns a 401 status code + * @throws {ErrorEscaped} error when the service returns a 404 status code + * @throws {ErrorEscaped} error when the service returns a 429 status code + * @throws {ErrorEscaped} error when the service returns a 500 status code + * @throws {ErrorEscaped} error when the service returns a 4XX or 5XX status code + */ + get(requestConfiguration?: RequestConfiguration | undefined) : Promise; + /** + * Retrieves a derived end-user view containing its sessions and OAuth connections. + * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. + * @returns {RequestInformation} + */ + toGetRequestInformation(requestConfiguration?: RequestConfiguration | undefined) : RequestInformation; +} +/** + * Uri template for the request builder. + */ +export const WithUser_ItemRequestBuilderUriTemplate = "{+baseurl}/v2/action-gateway/users/{user_id}"; +/** + * Metadata for all the requests in the request builder. + */ +export const WithUser_ItemRequestBuilderRequestsMetadata: RequestsMetadata = { + get: { + uriTemplate: WithUser_ItemRequestBuilderUriTemplate, + responseBodyContentType: "application/json", + errorMappings: { + 401: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 404: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 429: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + 500: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + XXX: createErrorEscapedFromDiscriminatorValue as ParsableFactory, + }, + adapterMethodName: "send", + responseBodyFactory: createGet_user_responseFromDiscriminatorValue, + }, +}; +/* tslint:enable */ +/* eslint-enable */ diff --git a/src/dots/v2/index.ts b/src/dots/v2/index.ts index 26a03e33f..833f0e7f3 100644 --- a/src/dots/v2/index.ts +++ b/src/dots/v2/index.ts @@ -4,6 +4,8 @@ // @ts-ignore import { AccountRequestBuilderNavigationMetadata, AccountRequestBuilderRequestsMetadata, type AccountRequestBuilder } from './account/index.js'; // @ts-ignore +import { ActionGatewayRequestBuilderNavigationMetadata, type ActionGatewayRequestBuilder } from './actionGateway/index.js'; +// @ts-ignore import { ActionsRequestBuilderNavigationMetadata, ActionsRequestBuilderRequestsMetadata, type ActionsRequestBuilder } from './actions/index.js'; // @ts-ignore import { AddOnsRequestBuilderNavigationMetadata, type AddOnsRequestBuilder } from './addOns/index.js'; @@ -98,6 +100,10 @@ export interface V2RequestBuilder extends BaseRequestBuilder { * The account property */ get account(): AccountRequestBuilder; + /** + * The actionGateway property + */ + get actionGateway(): ActionGatewayRequestBuilder; /** * The actions property */ @@ -279,6 +285,9 @@ export const V2RequestBuilderNavigationMetadata: Record { + afterEach(() => nock.cleanAll()); + + it("delegates session creation to the generated public API", async () => { + const requests: unknown[] = []; + const sessionsApi = { + post: async (body: unknown) => { + requests.push(body); + return sessionResponse(); + }, + } as unknown as SessionsRequestBuilder; + const sessions = new SessionsOperations( + "test-token", + new ChatCompletionsProvider(), + sessionsApi, + ); + + const session = await sessions.create({ + actorId: "user-123", + name: "support-session", + tools: ["toolbelt:search-toolbelt@1"], + config: { preloadTools: ["exa_web_search@v1"] }, + }); + + expect(requests).toEqual([{ + actorId: "user-123", + name: "support-session", + policy: { defaultAction: "ask", rules: [] }, + tools: ["toolbelt:search-toolbelt@1"], + config: { preloadTools: ["exa_web_search@v1"] }, + }]); + expect(session.url).toBe(MCP_URL); + }); + + it("creates sessions with typed policy, tools, and config", async () => { + const api = nock(API_BASE_URL) + .post("/v2/action-gateway/sessions", (body) => { + expect(body).toEqual({ + actor_id: "user-123", + name: "support-session", + policy: { + defaultAction: "ask", + rules: [{ tool: "toolbelt:search-toolbelt@1", action: "allow" }], + }, + tools: ["toolbelt:search-toolbelt@1"], + config: { preloadTools: ["exa_web_search@v1"] }, + }); + return true; + }) + .reply(200, sessionResponse()); + + const session = await client().session.create({ + actorId: "user-123", + name: "support-session", + permissions: { + defaultAction: "ask", + rules: [{ tool: "toolbelt:search-toolbelt@1", action: "allow" }], + }, + tools: ["toolbelt:search-toolbelt@1"], + config: { preloadTools: ["exa_web_search@v1"] }, + }); + + expect(session.id).toBe("session-123"); + expect(session.url).toBe(MCP_URL); + expect(session.selectedTools).toEqual(["exa_web_search@v1"]); + api.done(); + }); + + it("defaults session policy to ask", async () => { + const api = nock(API_BASE_URL) + .post("/v2/action-gateway/sessions", (body) => body.policy.defaultAction === "ask") + .reply(200, sessionResponse()); + + await client().session.create({ actorId: "user-123" }); + api.done(); + }); + + it("uses the returned MCP URL with session and actor headers", async () => { + nock(API_BASE_URL) + .post("/v2/action-gateway/sessions") + .reply(200, sessionResponse()); + const gateway = nock(GATEWAY_BASE_URL, { + reqheaders: { + "X-Session-Id": "session-123", + "X-Actor-Id": "user-123", + "MCP-Protocol-Version": "2025-06-18", + }, + }) + .post("/mcp/session/session-123", (body) => { + expect(body.method).toBe("tools/call"); + expect(body.params).toEqual({ + name: "action_invoke", + arguments: { + tools: [{ tool: "exa_web_search", arguments: { query: "DigitalOcean" } }], + }, + }); + return true; + }) + .reply(200, mcpResult({ + structuredContent: { + results: [{ + tool: "exa_web_search", + result: { status: "succeeded", output: { hits: 3 } }, + }], + }, + isError: false, + })); + + const session = await client().session.create({ actorId: "user-123" }); + const result = await session.toolsOperations.invokeOne("exa_web_search", { + query: "DigitalOcean", + }); + + expect(result).toEqual({ hits: 3 }); + gateway.done(); + }); + + it("approves and denies pending invocations", async () => { + nock(API_BASE_URL) + .post("/v2/action-gateway/sessions") + .reply(200, sessionResponse()); + const gateway = nock(GATEWAY_BASE_URL, { + reqheaders: { + "X-Session-Id": "session-123", + "X-Actor-Id": "user-123", + }, + }) + .post("/approvals/approval-1", { decision: "approve" }) + .reply(200, { status: "approved" }) + .post("/approvals/approval-2", { decision: "deny" }) + .reply(200, { status: "denied" }); + + const session = await client().session.create({ actorId: "user-123" }); + await expect(session.approve("approval-1")).resolves.toEqual({ status: "approved" }); + await expect(session.deny("approval-2")).resolves.toEqual({ status: "denied" }); + gateway.done(); + }); + + it("creates toolbelts through the generated public API", async () => { + const api = nock(API_BASE_URL) + .post("/v2/action-gateway/toolbelts", { + name: "search-toolbelt", + tools: ["exa_web_search", "exa_web_fetch"], + version: "1", + }) + .reply(200, { + toolbelt: { + name: "search-toolbelt", + version: "1", + tools: ["exa_web_search", "exa_web_fetch"], + status: "active", + reference: "search-toolbelt@1", + reference_latest: "search-toolbelt", + tool_count: 2, + created_at: "2026-07-24T00:00:00Z", + updated_at: "2026-07-24T00:00:00Z", + }, + }); + + const toolbelt = await client().createToolbelt({ + name: "search-toolbelt", + tools: ["exa_web_search", "exa_web_fetch"], + }); + + expect(toolbelt.reference).toBe("search-toolbelt@1"); + expect(toolbelt.ref).toBe("search-toolbelt@1"); + api.done(); + }); + + it("exposes generated list, get, add, remove, and delete operations", async () => { + const gateway = client(); + const toolbelt = { + name: "search-toolbelt", + version: "2", + tools: ["exa_web_search"], + status: "active", + reference: "search-toolbelt@2", + reference_latest: "search-toolbelt", + tool_count: 1, + created_at: "2026-07-24T00:00:00Z", + updated_at: "2026-07-24T00:00:00Z", + }; + + nock(API_BASE_URL) + .get("/v2/action-gateway/toolbelts") + .query({ status: "active" }) + .reply(200, { toolbelts: [], pagination: { page: 1, per_page: 20, total: 0 } }); + nock(API_BASE_URL) + .get("/v2/action-gateway/toolbelts/search-toolbelt") + .query({ version: "2" }) + .reply(200, { toolbelt }); + nock(API_BASE_URL) + .post("/v2/action-gateway/toolbelts/search-toolbelt/tools/add", { tools: ["exa_web_fetch"] }) + .reply(200, { toolbelt }); + nock(API_BASE_URL) + .post("/v2/action-gateway/toolbelts/search-toolbelt/tools/remove", { tools: ["exa_web_fetch"] }) + .reply(200, { toolbelt }); + nock(API_BASE_URL) + .delete("/v2/action-gateway/toolbelts/search-toolbelt") + .reply(200, { toolbelt }); + + await gateway.toolbelts.get({ queryParameters: { status: "active" } }); + const item = gateway.toolbelts.byName("search-toolbelt"); + await item.get({ queryParameters: { version: "2" } }); + await item.tools.add.post({ tools: ["exa_web_fetch"] }); + await item.tools.remove.post({ tools: ["exa_web_fetch"] }); + const deleted = await item.delete(); + + expect(deleted?.toolbelt?.status).toBe("active"); + expect(nock.isDone()).toBe(true); + }); + + it("formats tools for every inference surface", async () => { + nock(API_BASE_URL) + .post("/v2/action-gateway/sessions") + .times(3) + .reply(200, sessionResponse()); + + const chatSession = await client().session.create({ actorId: "user-123" }); + expect((await chatSession.tools())[0]).toMatchObject({ + type: "function", + function: { name: "action_search" }, + }); + + const messagesSession = await client(new MessagesProvider()).session.create({ actorId: "user-123" }); + expect((await messagesSession.tools())[0]).toMatchObject({ + name: "action_search", + input_schema: { type: "object" }, + }); + + const responsesSession = await client("responses").session.create({ actorId: "user-123" }); + const responseTools = await responsesSession.tools(); + expect(responseTools[0]).toMatchObject({ + type: "function", + name: "action_search", + parameters: { type: "object" }, + }); + expect(responseTools[0]).not.toHaveProperty("function"); + expect(JSON.stringify(responseTools)).not.toMatch(/Composio|tool_slug|code_to_execute/); + }); + + it("executes and formats model tool calls", async () => { + nock(API_BASE_URL) + .post("/v2/action-gateway/sessions") + .times(3) + .reply(200, sessionResponse()); + nock(GATEWAY_BASE_URL) + .post("/mcp/session/session-123") + .times(3) + .reply(200, mcpResult({ + structuredContent: { + results: [{ + tool: "exa_web_search", + result: { status: "succeeded", output: { hits: 1 } }, + }], + }, + isError: false, + })); + + const chatSession = await client().session.create({ actorId: "user-123" }); + expect(await chatSession.handleToolCalls({ + choices: [{ message: { tool_calls: [{ + id: "chat-1", + function: { name: "exa_web_search", arguments: '{"query":"DO"}' }, + }] } }], + })).toEqual([{ role: "tool", tool_call_id: "chat-1", content: '{"hits":1}' }]); + + const messagesSession = await client(new MessagesProvider()).session.create({ actorId: "user-123" }); + expect(await messagesSession.handleToolCalls({ + content: [{ type: "tool_use", id: "message-1", name: "exa_web_search", input: { query: "DO" } }], + })).toEqual([{ role: "user", content: [{ + type: "tool_result", + tool_use_id: "message-1", + content: '{"hits":1}', + }] }]); + + const responsesSession = await client(new ResponsesProvider()).session.create({ actorId: "user-123" }); + expect(await responsesSession.handleToolCalls({ + output: [{ + type: "function_call", + call_id: "response-1", + name: "exa_web_search", + arguments: '{"query":"DO"}', + }], + })).toEqual([{ + type: "function_call_output", + call_id: "response-1", + output: '{"hits":1}', + }]); + }); + + it("preserves approval metadata in model tool results", async () => { + nock(API_BASE_URL) + .post("/v2/action-gateway/sessions") + .reply(200, sessionResponse()); + nock(GATEWAY_BASE_URL) + .post("/mcp/session/session-123") + .reply(200, mcpResult({ + structuredContent: { + results: [{ + tool: "exa_web_search", + result: { + status: "failed", + error: { message: "approval required" }, + _meta: { + status: "requires_approval", + approval_id: "approval-123", + }, + }, + }], + }, + isError: false, + })) + .post("/mcp/session/session-123") + .reply(200, mcpResult({ + content: [{ type: "text", text: "approval required" }], + isError: true, + _meta: { + status: "requires_approval", + approval_id: "approval-123", + }, + })); + + const session = await client().session.create({ actorId: "user-123" }); + const messages = await session.handleToolCalls({ + choices: [{ message: { tool_calls: [{ + id: "chat-1", + function: { name: "exa_web_search", arguments: '{"query":"DO"}' }, + }] } }], + }); + + expect(JSON.parse(String(messages[0].content))).toMatchObject({ + error: { message: "approval required" }, + _meta: { approval_id: "approval-123" }, + }); + + const directMessages = await session.handleToolCalls({ + choices: [{ message: { tool_calls: [{ + id: "chat-2", + function: { name: "action_search", arguments: '{"queries":["search"]}' }, + }] } }], + }); + + expect(JSON.parse(String(directMessages[0].content))).toMatchObject({ + error: { message: "approval required" }, + _meta: { approval_id: "approval-123" }, + }); + }); +});