export type UpdateApiV1SessionsSessionIdSaveProfileOnTerminationProfileNameArgs = {sessionId: string, profileName: string}; export type UpdateApiV1SessionsSessionIdSaveProfileOnTerminationProfileNameOptions = {baseUrl?: string | undefined, defaultValue?: string | undefined, fetch?: typeof fetch | undefined}; /** * Save profile on termination * * PUT /v1/sessions/{sessionId}/save-profile-on-termination/{profileName} */ export const updateApiV1SessionsSessionIdSaveProfileOnTerminationProfileName = async (args: UpdateApiV1SessionsSessionIdSaveProfileOnTerminationProfileNameArgs, options?: UpdateApiV1SessionsSessionIdSaveProfileOnTerminationProfileNameOptions) => { const {baseUrl = "https://api.airtop.ai/api", fetch: fetchFn = fetch, defaultValue} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (defaultValue !== undefined) headers.set('authorization', `Bearer ${defaultValue}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/sessions/${encodeURIComponent(String(args.sessionId))}/save-profile-on-termination/${encodeURIComponent(String(args.profileName))}${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 };