export type BetConstructSSOAuthAPIViewModelsApiResourceUpdateViewModel = {enabled?: boolean | undefined, name?: (string | null) | undefined, displayName?: (string | null) | undefined, description?: (string | null) | undefined, nonEditable?: boolean | undefined}; export type UpdateApiV1ApiResourcesIdArgs = {id: number, body: BetConstructSSOAuthAPIViewModelsApiResourceUpdateViewModel}; export type UpdateApiV1ApiResourcesIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /V1/apiResources/{id} */ export const updateApiV1ApiResourcesId = async (args: UpdateApiV1ApiResourcesIdArgs, options: UpdateApiV1ApiResourcesIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/V1/apiResources/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };