/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { budgetsSetExternalUser } from "../../funcs/budgetsSetExternalUser.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.SetExternalUserBudgetRequest$inboundSchema, }; export const tool$budgetsSetExternalUser: ToolDefinition = { name: "budgets-set-external-user", description: `Set a external user budget Creates or updates a budget for the external user in the target org. One budget per (scope, owner); editing re-evaluates against live spend. An explicit external user budget replaces the org's per-external user default budget of the same owner and period for this external user (exemption-by-override — it may raise or tighten it); different-period defaults, org budgets, and API-key budgets still apply. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only. Callable by cluster admins, or org admins for external users in their own organization (owner=org).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await budgetsSetExternalUser( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };