export type DeleteApiV1AssetsAssetIdSegmentsSegmentIdArgs = {'App-ID': string, 'Auth-Token': string, asset_id: string, segment_id: string, soft_delete?: boolean | undefined}; export type DeleteApiV1AssetsAssetIdSegmentsSegmentIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete a particular segment from an asset by id * * DELETE /v1/assets/{asset_id}/segments/{segment_id}/ */ export const deleteApiV1AssetsAssetIdSegmentsSegmentId = async (args: DeleteApiV1AssetsAssetIdSegmentsSegmentIdArgs, options: DeleteApiV1AssetsAssetIdSegmentsSegmentIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args.soft_delete != null) query.append("soft_delete", String(args.soft_delete)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets/${encodeURIComponent(String(args.asset_id))}/segments/${encodeURIComponent(String(args.segment_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 };