export type UpdateApiSkeV2alpha1Thr1FreeWorkspacesWorkspaceUUIDSotoonaddonsResourceIdArgs = {workspaceUUID: string, resourceId: string}; export type UpdateApiSkeV2alpha1Thr1FreeWorkspacesWorkspaceUUIDSotoonaddonsResourceIdOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replace Addon * * PUT /ske/v2alpha1/thr1-free/workspaces/{workspaceUUID}/sotoonaddons/{resourceId} */ export const updateApiSkeV2alpha1Thr1FreeWorkspacesWorkspaceUUIDSotoonaddonsResourceId = async (args: UpdateApiSkeV2alpha1Thr1FreeWorkspacesWorkspaceUUIDSotoonaddonsResourceIdArgs, options: UpdateApiSkeV2alpha1Thr1FreeWorkspacesWorkspaceUUIDSotoonaddonsResourceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerToken !== undefined) headers.set('authorization', `Bearer ${BearerToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/ske/v2alpha1/thr1-free/workspaces/${encodeURIComponent(String(args.workspaceUUID))}/sotoonaddons/${encodeURIComponent(String(args.resourceId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };