export type DeleteApiMeFollowingsUserUrnArgs = {user_urn: string}; export type DeleteApiMeFollowingsUserUrnOptions = {baseUrl?: string | undefined, AuthHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a user who is followed by the authenticated user. * * DELETE /me/followings/{user_urn} * * Also accepts auth: oAuth2_1 */ export const deleteApiMeFollowingsUserUrn = async (args: DeleteApiMeFollowingsUserUrnArgs, options?: DeleteApiMeFollowingsUserUrnOptions) => { const {baseUrl = "https://api.soundcloud.com", fetch: fetchFn = fetch, AuthHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json; charset=utf-8") if (AuthHeader !== undefined) headers.set("Authorization", AuthHeader) const url = `${baseUrl.replace(/\/+$/, '')}/me/followings/${encodeURIComponent(String(args.user_urn))}${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 (await res.json()) as unknown };