// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

export interface LineInsightFromCallTable {
    /** This is the name of the Insight. */
    name?: string | undefined;
    /**
     * This is the type of the Insight.
     * It is required to be `line` to create a line insight.
     */
    type: Vapi.LineInsightFromCallTableType;
    /**
     * Formulas are mathematical expressions applied on the data returned by the queries to transform them before being used to create the insight.
     * The formulas needs to be a valid mathematical expression, supported by MathJS - https://mathjs.org/docs/expressions/syntax.html
     * A formula is created by using the query names as the variable.
     * The formulas must contain at least one query name in the LiquidJS format {{query_name}} or {{['query name']}} which will be substituted with the query result.
     * For example, if you have 2 queries, 'Was Booking Made' and 'Average Call Duration', you can create a formula like this:
     * ```
     * {{['Query 1']}} / {{['Query 2']}} * 100
     * ```
     *
     * ```
     * ({{[Query 1]}} * 10) + {{[Query 2]}}
     * ```
     * This will take the
     *
     * You can also use the query names as the variable in the formula.
     */
    formulas?: Vapi.InsightFormula[] | undefined;
    /** This is the metadata for the insight. */
    metadata?: Vapi.LineInsightMetadata | undefined;
    timeRange?: Vapi.InsightTimeRangeWithStep | undefined;
    /**
     * This is the group by column for the insight when table is `call`.
     * These are the columns to group the results by.
     * All results are grouped by the time range step by default.
     */
    groupBy?: Vapi.LineInsightFromCallTableGroupBy | undefined;
    /** These are the queries to run to generate the insight. */
    queries: Vapi.LineInsightFromCallTableQueriesItem[];
}
