export type DeleteApiAssetsAssetIdDynamicSegmentsSegmentIdArgs = {asset_id: string, segment_id: string}; export type DeleteApiAssetsAssetIdDynamicSegmentsSegmentIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a dynamic segment * * DELETE /assets/{asset_id}/dynamic-segments/{segment_id} */ export const deleteApiAssetsAssetIdDynamicSegmentsSegmentId = async (args: DeleteApiAssetsAssetIdDynamicSegmentsSegmentIdArgs, options?: DeleteApiAssetsAssetIdDynamicSegmentsSegmentIdOptions) => { const {baseUrl = "https://enterprise.knak.io/api/published/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/assets/${encodeURIComponent(String(args.asset_id))}/dynamic-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 };