export type UpdateApiPipelineGatewayRouteGatewayRouteIdArgs = {gateway_route_id: string, body: {title: string, description?: (string | null) | undefined, type: 'http' | 'splunk-hec' | 'kinesis-firehose' | 'fluent' | 'logstash' | 'mezmo-agent' | 'mezmo-datadog-source' | 'webhook' | 'prometheus-remote-write' | 'open-telemetry-metrics' | 'open-telemetry-logs' | 'open-telemetry-traces', legacy_routing?: boolean | undefined}}; export type UpdateApiPipelineGatewayRouteGatewayRouteIdOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update gateway route * * PUT /pipeline/gateway-route/{gateway_route_id} */ export const updateApiPipelineGatewayRouteGatewayRouteId = async (args: UpdateApiPipelineGatewayRouteGatewayRouteIdArgs, options?: UpdateApiPipelineGatewayRouteGatewayRouteIdOptions) => { 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/gateway-route/${encodeURIComponent(String(args.gateway_route_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 };