export type BulkDeleteCardsFromCardHierarchyGroupV1Request = {cardIds: Array}; export type DeleteApiV1CardHierarchiesCardHierarchyIdGroupsGroupIdCardsBulkArgs = {cardHierarchyId: unknown, groupId: unknown, auditUser: string, body: BulkDeleteCardsFromCardHierarchyGroupV1Request}; export type DeleteApiV1CardHierarchiesCardHierarchyIdGroupsGroupIdCardsBulkOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Bulk Delete Cards from Group * * DELETE /v1/card-hierarchies/{cardHierarchyId}/groups/{groupId}/cards/bulk */ export const deleteApiV1CardHierarchiesCardHierarchyIdGroupsGroupIdCardsBulk = async (args: DeleteApiV1CardHierarchiesCardHierarchyIdGroupsGroupIdCardsBulkArgs, options: DeleteApiV1CardHierarchiesCardHierarchyIdGroupsGroupIdCardsBulkOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.auditUser != null) query.append("auditUser", String(args.auditUser)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/card-hierarchies/${encodeURIComponent(String(args.cardHierarchyId))}/groups/${encodeURIComponent(String(args.groupId))}/cards/bulk${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 };