export type DeleteApiV1SubscriptionsIdArgs = {id: string}; export type DeleteApiV1SubscriptionsIdOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a single subscription * * DELETE /v1/subscriptions/{id} * * Also accepts auth: oauth2 */ export const deleteApiV1SubscriptionsId = async (args: DeleteApiV1SubscriptionsIdArgs, options?: DeleteApiV1SubscriptionsIdOptions) => { const {baseUrl = "https://api.domain.com.au", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apikey !== undefined) headers.set("x-api-key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/subscriptions/${encodeURIComponent(String(args.id))}${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 };