export type UpdateApiPipelinePipelineIdSourcePipelineSourceIdArgs = {pipeline_id: string, pipeline_source_id: string, body: {title?: (string | null) | undefined, description?: (string | null) | undefined, type: 'http' | 'splunk-hec' | 's3' | 'sqs' | 'demo-logs' | 'kinesis-firehose' | 'fluent' | 'log-analysis' | 'log-analysis-ingestion' | 'logstash' | 'mezmo-agent' | 'mezmo-datadog-source' | 'pipeline-data-restoration' | 'webhook' | 'kafka' | 'azure-event-hub' | 'prometheus-remote-write' | 'open-telemetry-metrics' | 'open-telemetry-logs' | 'open-telemetry-traces', deploy_type?: ('saas' | 'local') | undefined, user_config: Record, generation_id: number}}; export type UpdateApiPipelinePipelineIdSourcePipelineSourceIdOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update source * * PUT /pipeline/{pipeline_id}/source/{pipeline_source_id} */ export const updateApiPipelinePipelineIdSourcePipelineSourceId = async (args: UpdateApiPipelinePipelineIdSourcePipelineSourceIdArgs, options?: UpdateApiPipelinePipelineIdSourcePipelineSourceIdOptions) => { 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 (PipelineServiceKey !== undefined) headers.set("Authorization", PipelineServiceKey) const url = `${baseUrl.replace(/\/+$/, '')}/pipeline/${encodeURIComponent(String(args.pipeline_id))}/source/${encodeURIComponent(String(args.pipeline_source_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };