export type DeleteApiV1GroupsIdAssetsArgs = {id: number, 'ids[]'?: Array | undefined, 'X-Time-Zone'?: string | undefined, 'X-Metric-Units'?: boolean | undefined, 'X-User-Id'?: number | undefined}; export type DeleteApiV1GroupsIdAssetsOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an asset from a group * * DELETE /v1/groups/{id}/assets */ export const deleteApiV1GroupsIdAssets = async (args: DeleteApiV1GroupsIdAssetsArgs, options?: DeleteApiV1GroupsIdAssetsOptions) => { const {baseUrl = "https://api.gomotive.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") for (const item of args['ids[]'] ?? []) query.append("ids[]", String(item)) if (args['X-Time-Zone'] != null) headers.set("X-Time-Zone", String(args['X-Time-Zone'])) if (args['X-Metric-Units'] != null) headers.set("X-Metric-Units", String(args['X-Metric-Units'])) if (args['X-User-Id'] != null) headers.set("X-User-Id", String(args['X-User-Id'])) if (sec0 !== undefined) headers.set("x-api-key", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/v1/groups/${encodeURIComponent(String(args.id))}/assets${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 (await res.json()) as unknown };