export type DeleteApiApiAssetGroupsGroupIdArgs = {group_id: string, 'X-Workspace-Id'?: (string | null) | undefined}; export type DeleteApiApiAssetGroupsGroupIdOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Group * * DELETE /api/asset-groups/{group_id} */ export const deleteApiApiAssetGroupsGroupId = async (args: DeleteApiApiAssetGroupsGroupIdArgs, options: DeleteApiApiAssetGroupsGroupIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Workspace-Id'] != null) headers.set("X-Workspace-Id", String(args['X-Workspace-Id'])) if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/asset-groups/${encodeURIComponent(String(args.group_id))}${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 };