export type UpdateApiV1ProviderInstancesInstanceIdCallbackArgs = {instanceId: number}; export type UpdateApiV1ProviderInstancesInstanceIdCallbackOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /v1/providerInstances/{instanceId}/callback */ export const updateApiV1ProviderInstancesInstanceIdCallback = async (args: UpdateApiV1ProviderInstancesInstanceIdCallbackArgs, options: UpdateApiV1ProviderInstancesInstanceIdCallbackOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/providerInstances/${encodeURIComponent(String(args.instanceId))}/callback${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 };