export type AgentBinaryPatchMultiple = {data: Array<{id: number, type: 'agentBinary', attributes: {binaryType?: string | undefined, filename?: string | undefined, operatingSystems?: string | undefined, updateTrack?: string | undefined, version?: string | undefined}}>}; export type PatchApiApiV2UiAgentbinariesArgs = {body: AgentBinaryPatchMultiple}; export type PatchApiApiV2UiAgentbinariesOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update AgentBinarys * * PATCH /api/v2/ui/agentbinaries */ export const patchApiApiV2UiAgentbinaries = async (args: PatchApiApiV2UiAgentbinariesArgs, options: PatchApiApiV2UiAgentbinariesOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/ui/agentbinaries${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };