export type GetApiPipelineMetricUsageProfileLogClusteringSamplesArgs = {id: string, log_cluster_id: string, from: string, to?: string | undefined, limit?: number | undefined}; export type GetApiPipelineMetricUsageProfileLogClusteringSamplesOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Fetch log cluster samples * * GET /pipeline/metric/usage/profile/log-clustering/samples */ export const getApiPipelineMetricUsageProfileLogClusteringSamples = async (args: GetApiPipelineMetricUsageProfileLogClusteringSamplesArgs, options?: GetApiPipelineMetricUsageProfileLogClusteringSamplesOptions) => { const {baseUrl = "https://api.mezmo.com/v3", fetch: fetchFn = fetch, PipelineServiceKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) if (args.log_cluster_id != null) query.append("log_cluster_id", String(args.log_cluster_id)) if (args.from != null) query.append("from", String(args.from)) if (args.to != null) query.append("to", String(args.to)) if (args.limit != null) query.append("limit", String(args.limit)) if (PipelineServiceKey !== undefined) headers.set("Authorization", PipelineServiceKey) const url = `${baseUrl.replace(/\/+$/, '')}/pipeline/metric/usage/profile/log-clustering/samples${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };