export type DeleteApiSessionConfigurationsArgs = {Accept: string, 'Content-Type': 'application/json', type: 'mobile' | 'web'}; export type DeleteApiSessionConfigurationsOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an account's session configurations. * * DELETE /session_configurations */ export const deleteApiSessionConfigurations = async (args: DeleteApiSessionConfigurationsArgs, options?: DeleteApiSessionConfigurationsOptions) => { const {baseUrl = "https://api.pagerduty.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.type != null) query.append("type", String(args.type)) if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/session_configurations${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };