export type DeleteApiContractItemsContractItemIdUsageArgs = {contract_item_id: string, date: string}; export type DeleteApiContractItemsContractItemIdUsageOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a usage record * * DELETE /contract-items/{contract_item_id}/usage */ export const deleteApiContractItemsContractItemIdUsage = async (args: DeleteApiContractItemsContractItemIdUsageArgs, options?: DeleteApiContractItemsContractItemIdUsageOptions) => { const {baseUrl = "https://api.rillet.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.date != null) query.append("date", String(args.date)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/contract-items/${encodeURIComponent(String(args.contract_item_id))}/usage${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 };