export type ListOfId4ns = {id4ns?: Array | undefined}; export type DeleteApiApiV1ApikeysKeyPrivilegesPrivilegeId4nsArgs = {key: string, privilege: string, body: ListOfId4ns}; export type DeleteApiApiV1ApikeysKeyPrivilegesPrivilegeId4nsOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove id4ns of a privilege * * DELETE /api/v1/apikeys/{key}/privileges/{privilege}/id4ns */ export const deleteApiApiV1ApikeysKeyPrivilegesPrivilegeId4ns = async (args: DeleteApiApiV1ApikeysKeyPrivilegesPrivilegeId4nsArgs, options: DeleteApiApiV1ApikeysKeyPrivilegesPrivilegeId4nsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/apikeys/${encodeURIComponent(String(args.key))}/privileges/${encodeURIComponent(String(args.privilege))}/id4ns${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };