export type CreateApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDSotoonaddonsResourceIdArgs = {resourceId: string, workspaceUUID: string}; export type CreateApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDSotoonaddonsResourceIdOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Addon * * POST /ske/v2alpha1/thr1-premium/workspaces/{workspaceUUID}/sotoonaddons/{resourceId} */ export const createApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDSotoonaddonsResourceId = async (args: CreateApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDSotoonaddonsResourceIdArgs, options: CreateApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDSotoonaddonsResourceIdOptions) => { 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-premium/workspaces/${encodeURIComponent(String(args.workspaceUUID))}/sotoonaddons/${encodeURIComponent(String(args.resourceId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };