export type CreateApiPipelinePipelineIdLogVolumeReductionArgs = {create_new_classifier_analysis?: boolean | undefined, pipeline_id: string, body: {place_before_transform_id?: string | undefined, processor_title: string, actions: Array<{type?: ('dedupe' | 'filter' | 'sample' | 'throttle' | 'drop-field') | undefined, title?: (string | null) | undefined, drain: string, field_summary?: ({field: string, value?: (string | null) | undefined}) | undefined, description?: (string | null) | undefined, user_config?: Record | undefined} | {type?: ('dedupe' | 'filter' | 'sample' | 'throttle' | 'drop-field') | undefined, title?: (string | null) | undefined, drain?: string | undefined, field_summary: {field: string, value?: (string | null) | undefined}, description?: (string | null) | undefined, user_config?: Record | undefined}>}}; export type CreateApiPipelinePipelineIdLogVolumeReductionOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Log Volume Reduction * * POST /pipeline/{pipeline_id}/log-volume-reduction */ export const createApiPipelinePipelineIdLogVolumeReduction = async (args: CreateApiPipelinePipelineIdLogVolumeReductionArgs, options?: CreateApiPipelinePipelineIdLogVolumeReductionOptions) => { const {baseUrl = "https://api.mezmo.com/v3", fetch: fetchFn = fetch, PipelineServiceKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.create_new_classifier_analysis != null) query.append("create_new_classifier_analysis", String(args.create_new_classifier_analysis)) if (PipelineServiceKey !== undefined) headers.set("Authorization", PipelineServiceKey) const url = `${baseUrl.replace(/\/+$/, '')}/pipeline/${encodeURIComponent(String(args.pipeline_id))}/log-volume-reduction${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };