import { Archon } from "../Archon.js";
import { ARID } from "../types/policy.js";

/**
 * Delete a resource by its ARID.
 * @param arid - The ARID of the resource to delete.
 * @returns A promise resolving when the resource is deleted.
 */
export default async function deleteResourceById(arid: ARID): Promise<void> {
    const response = await Archon.request(`/policy/resource/${arid}`, "DELETE");

    if (response.status !== 200) {
        throw new Error(`Failed to delete resource with ARID ${arid}: ${response.data}`);
    }
}

