export type DeleteApiAuthRolesTenantTenantLocatorRoleLocatorArgs = {tenantLocator: string, roleLocator: unknown}; export type DeleteApiAuthRolesTenantTenantLocatorRoleLocatorOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /auth/roles/tenant/{tenantLocator}/{roleLocator} */ export const deleteApiAuthRolesTenantTenantLocatorRoleLocator = async (args: DeleteApiAuthRolesTenantTenantLocatorRoleLocatorArgs, options: DeleteApiAuthRolesTenantTenantLocatorRoleLocatorOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/auth/roles/tenant/${encodeURIComponent(String(args.tenantLocator))}/${encodeURIComponent(String(args.roleLocator))}${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 };