{
  "openapi": "3.0.0",
  "info": {
    "title": "mprove backend",
    "description": "",
    "version": "12.0.27",
    "contact": {}
  },
  "paths": {
    "/api/ToBackendGetQueryInfo": {
      "post": {
        "operationId": "GetQueryInfoController",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToBackendGetQueryInfoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToBackendGetQueryInfoResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ToBackendGetQueryInfoRequest": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/ToBackendGetQueryInfoRequestInfo"
          },
          "payload": {
            "$ref": "#/components/schemas/ToBackendGetQueryInfoRequestPayload"
          }
        },
        "required": [
          "info",
          "payload"
        ]
      },
      "ToBackendGetQueryInfoResponse": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/ToBackendGetQueryInfoResponseInfo"
          },
          "payload": {
            "$ref": "#/components/schemas/ToBackendGetQueryInfoResponsePayload"
          }
        },
        "required": [
          "info",
          "payload"
        ]
      },
      "ToBackendGetQueryInfoRequestInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "api/ToBackendGetQueryInfo"
            ]
          },
          "traceId": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "traceId",
          "idempotencyKey"
        ]
      },
      "ToBackendGetQueryInfoRequestPayload": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "repoId": {
            "type": "string"
          },
          "branchId": {
            "type": "string"
          },
          "envId": {
            "type": "string"
          },
          "chartId": {
            "type": "string",
            "nullable": true
          },
          "dashboardId": {
            "type": "string",
            "nullable": true
          },
          "tileIndex": {
            "type": "number",
            "nullable": true
          },
          "reportId": {
            "type": "string",
            "nullable": true
          },
          "rowId": {
            "type": "string",
            "nullable": true
          },
          "timezone": {
            "type": "string"
          },
          "timeSpec": {
            "type": "string",
            "enum": [
              "timestamps",
              "seconds",
              "minutes",
              "hours",
              "days",
              "weeks",
              "months",
              "quarters",
              "years"
            ],
            "nullable": true
          },
          "timeRangeFractionBrick": {
            "type": "string",
            "nullable": true
          },
          "getMalloy": {
            "type": "boolean"
          },
          "getSql": {
            "type": "boolean"
          },
          "getData": {
            "type": "boolean"
          },
          "isFetch": {
            "type": "boolean"
          }
        },
        "required": [
          "projectId",
          "repoId",
          "branchId",
          "envId",
          "timezone",
          "getMalloy",
          "getSql",
          "getData",
          "isFetch"
        ]
      },
      "ToBackendGetQueryInfoResponseInfo": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "enum": [
              "/api/ToBackendGetQueryInfo"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "POST"
            ]
          },
          "mproveVersion": {
            "type": "string",
            "nullable": true
          },
          "duration": {
            "type": "number",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "Ok",
              "Error"
            ]
          },
          "traceId": {
            "type": "string"
          },
          "error": {
            "nullable": true
          }
        },
        "required": [
          "path",
          "method",
          "status",
          "traceId"
        ]
      },
      "ToBackendGetQueryInfoResponsePayload": {
        "type": "object",
        "properties": {
          "chart": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QueryInfoChart"
              }
            ],
            "nullable": true
          },
          "dashboard": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QueryInfoDashboard"
              }
            ],
            "nullable": true
          },
          "report": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QueryInfoReport"
              }
            ],
            "nullable": true
          }
        }
      },
      "QueryInfoChart": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "chartId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "query": {
            "$ref": "#/components/schemas/QueryInfoQuery"
          }
        },
        "required": [
          "title",
          "chartId",
          "url",
          "query"
        ]
      },
      "QueryInfoDashboard": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "dashboardId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "tiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryInfoTile"
            }
          }
        },
        "required": [
          "title",
          "dashboardId",
          "url",
          "tiles"
        ]
      },
      "QueryInfoReport": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "reportId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueryInfoRow"
            }
          }
        },
        "required": [
          "title",
          "reportId",
          "url",
          "rows"
        ]
      },
      "QueryInfoQuery": {
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "connectionType": {
            "type": "string",
            "enum": [
              "PostgreSQL",
              "MySQL",
              "SnowFlake",
              "BigQuery",
              "Databricks",
              "MotherDuck",
              "Presto",
              "Trino",
              "GoogleApi",
              "Api"
            ]
          },
          "queryId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "New",
              "Running",
              "Canceled",
              "Completed",
              "Error"
            ]
          },
          "lastRunBy": {
            "type": "string",
            "nullable": true
          },
          "lastRunTs": {
            "type": "number",
            "nullable": true
          },
          "lastCancelTs": {
            "type": "number",
            "nullable": true
          },
          "lastCompleteTs": {
            "type": "number",
            "nullable": true
          },
          "lastCompleteDuration": {
            "type": "number",
            "nullable": true
          },
          "lastErrorMessage": {
            "type": "string",
            "nullable": true
          },
          "lastErrorTs": {
            "type": "number",
            "nullable": true
          },
          "data": {
            "nullable": true
          },
          "malloy": {
            "type": "string",
            "nullable": true
          },
          "sql": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "connectionId",
          "connectionType",
          "queryId",
          "status"
        ]
      },
      "QueryInfoTile": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "query": {
            "$ref": "#/components/schemas/QueryInfoQuery"
          }
        },
        "required": [
          "title",
          "query"
        ]
      },
      "QueryInfoRow": {
        "type": "object",
        "properties": {
          "rowId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rowType": {
            "type": "string",
            "enum": [
              "empty",
              "header",
              "metric",
              "formula"
            ]
          },
          "metricId": {
            "type": "string"
          },
          "formula": {
            "type": "string"
          },
          "parameters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Parameter"
            }
          },
          "query": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QueryInfoQuery"
              }
            ],
            "nullable": true
          },
          "records": {
            "type": "array",
            "items": {},
            "nullable": true
          }
        },
        "required": [
          "rowId",
          "name",
          "rowType",
          "metricId",
          "formula",
          "parameters"
        ]
      },
      "Parameter": {
        "type": "object",
        "properties": {
          "apply_to": {
            "type": "string"
          },
          "listen": {
            "type": "string"
          },
          "fractions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fraction"
            }
          }
        },
        "required": [
          "apply_to",
          "listen",
          "fractions"
        ]
      },
      "Fraction": {
        "type": "object",
        "properties": {
          "controls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FractionControl"
            },
            "nullable": true
          },
          "brick": {
            "type": "string",
            "nullable": true
          },
          "parentBrick": {
            "type": "string",
            "nullable": true
          },
          "operator": {
            "type": "string",
            "enum": [
              "Or",
              "And"
            ],
            "nullable": true
          },
          "logicGroup": {
            "type": "string",
            "enum": [
              "OR",
              "AND_NOT"
            ],
            "nullable": true
          },
          "type": {
            "type": "string",
            "enum": [
              "StoreFraction",
              "StringIsAnyValue",
              "StringIsEqualTo",
              "StringStartsWith",
              "StringEndsWith",
              "StringContains",
              "StringIsLike",
              "StringIsEmpty",
              "StringIsNull",
              "StringIsNotEqualTo",
              "StringDoesNotStartWith",
              "StringDoesNotEndWith",
              "StringDoesNotContain",
              "StringIsNotLike",
              "StringIsNotEmpty",
              "StringIsNotNull",
              "NumberIsAnyValue",
              "NumberIsEqualTo",
              "NumberIsGreaterThan",
              "NumberIsGreaterThanOrEqualTo",
              "NumberIsLessThan",
              "NumberIsLessThanOrEqualTo",
              "NumberIsBetween",
              "NumberIsNull",
              "NumberIsNotEqualTo",
              "NumberIsNotGreaterThan",
              "NumberIsNotGreaterThanOrEqualTo",
              "NumberIsNotLessThan",
              "NumberIsNotLessThanOrEqualTo",
              "NumberIsNotBetween",
              "NumberIsNotNull",
              "BooleanIsAnyValue",
              "BooleanIsTrue",
              "BooleanIsFalse",
              "BooleanIsTruthy",
              "BooleanIsFalsy",
              "BooleanIsNull",
              "BooleanIsNotTrue",
              "BooleanIsNotFalse",
              "BooleanIsNotTruthy",
              "BooleanIsNotFalsy",
              "BooleanIsNotNull",
              "TsIsAnyValue",
              "TsIsInLast",
              "TsIsOnDay",
              "TsIsOnWeek",
              "TsIsOnMonth",
              "TsIsOnQuarter",
              "TsIsOnYear",
              "TsIsInNext",
              "TsIsAfter",
              "TsIsStarting",
              "TsIsBeginFor",
              "TsIsBetween",
              "TsIsBefore",
              "TsIsThrough",
              "TsIsOnHour",
              "TsIsOnMinute",
              "TsIsOnTimestamp",
              "TsIsNull",
              "TsIsNotInLast",
              "TsIsNotOnDay",
              "TsIsNotOnWeek",
              "TsIsNotOnMonth",
              "TsIsNotOnQuarter",
              "TsIsNotOnYear",
              "TsIsNotInNext",
              "TsIsNotBeginFor",
              "TsIsNotBetween",
              "TsIsNotOnHour",
              "TsIsNotOnMinute",
              "TsIsNotOnTimestamp",
              "TsIsNotNull",
              "DayOfWeekIsAnyValue",
              "DayOfWeekIs",
              "DayOfWeekIsNull",
              "DayOfWeekIsNot",
              "DayOfWeekIsNotNull",
              "DayOfWeekIndexIsAnyValue",
              "DayOfWeekIndexIsEqualTo",
              "DayOfWeekIndexIsNull",
              "DayOfWeekIndexIsNotEqualTo",
              "DayOfWeekIndexIsNotNull",
              "MonthNameIsAnyValue",
              "MonthNameIs",
              "MonthNameIsNull",
              "MonthNameIsNot",
              "MonthNameIsNotNull",
              "QuarterOfYearIsAnyValue",
              "QuarterOfYearIs",
              "QuarterOfYearIsNull",
              "QuarterOfYearIsNot",
              "QuarterOfYearIsNotNull",
              "TsIsBeforeRelative",
              "TsIsAfterRelative",
              "YesnoIsAnyValue",
              "YesnoIs"
            ]
          },
          "storeFractionSubTypeOptions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FractionSubTypeOption"
            },
            "nullable": true
          },
          "storeFractionSubType": {
            "type": "string",
            "nullable": true
          },
          "storeFractionSubTypeLabel": {
            "type": "string",
            "nullable": true
          },
          "storeFractionLogicGroupWithSubType": {
            "type": "string",
            "nullable": true
          },
          "meta": {
            "nullable": true
          },
          "storeResult": {
            "type": "string",
            "nullable": true
          },
          "stringValue": {
            "type": "string",
            "nullable": true
          },
          "numberValue1": {
            "type": "number",
            "nullable": true
          },
          "numberValue2": {
            "type": "number",
            "nullable": true
          },
          "numberValues": {
            "type": "string",
            "nullable": true
          },
          "numberBetweenOption": {
            "type": "string",
            "enum": [
              "Inclusive",
              "LeftInclusive",
              "RightInclusive",
              "Exclusive"
            ],
            "nullable": true
          },
          "yesnoValue": {
            "type": "string",
            "enum": [
              "Yes",
              "No"
            ],
            "nullable": true
          },
          "dayOfWeekValue": {
            "type": "string",
            "enum": [
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday",
              "Sunday"
            ],
            "nullable": true
          },
          "dayOfWeekIndexValues": {
            "type": "string",
            "nullable": true
          },
          "monthNameValue": {
            "type": "string",
            "enum": [
              "January",
              "February",
              "March",
              "April",
              "May",
              "June",
              "July",
              "August",
              "September",
              "October",
              "November",
              "December"
            ],
            "nullable": true
          },
          "quarterOfYearValue": {
            "type": "string",
            "enum": [
              "q1",
              "q2",
              "q3",
              "q4"
            ],
            "nullable": true
          },
          "tsDateYear": {
            "type": "number",
            "nullable": true
          },
          "tsDateQuarter": {
            "type": "number",
            "nullable": true
          },
          "tsDateMonth": {
            "type": "number",
            "nullable": true
          },
          "tsDateDay": {
            "type": "number",
            "nullable": true
          },
          "tsDateHour": {
            "type": "number",
            "nullable": true
          },
          "tsDateMinute": {
            "type": "number",
            "nullable": true
          },
          "tsDateToYear": {
            "type": "number",
            "nullable": true
          },
          "tsDateToQuarter": {
            "type": "number",
            "nullable": true
          },
          "tsDateToMonth": {
            "type": "number",
            "nullable": true
          },
          "tsDateToDay": {
            "type": "number",
            "nullable": true
          },
          "tsDateToHour": {
            "type": "number",
            "nullable": true
          },
          "tsDateToMinute": {
            "type": "number",
            "nullable": true
          },
          "tsForValue": {
            "type": "number",
            "nullable": true
          },
          "tsForUnit": {
            "type": "string",
            "enum": [
              "seconds",
              "minutes",
              "hours",
              "days",
              "weeks",
              "months",
              "quarters",
              "years"
            ],
            "nullable": true
          },
          "tsLastValue": {
            "type": "number",
            "nullable": true
          },
          "tsLastUnit": {
            "type": "string",
            "enum": [
              "seconds",
              "minutes",
              "hours",
              "days",
              "weeks",
              "months",
              "quarters",
              "years"
            ],
            "nullable": true
          },
          "tsLastCompleteOption": {
            "type": "string",
            "enum": [
              "CompleteWithCurrent",
              "CompletePlusCurrent",
              "Complete"
            ],
            "nullable": true
          },
          "tsNextValue": {
            "type": "number",
            "nullable": true
          },
          "tsNextUnit": {
            "type": "string",
            "enum": [
              "seconds",
              "minutes",
              "hours",
              "days",
              "weeks",
              "months",
              "quarters",
              "years"
            ],
            "nullable": true
          },
          "tsMoment": {
            "nullable": true
          },
          "tsMomentType": {
            "type": "string",
            "enum": [
              "Literal",
              "Today",
              "Yesterday",
              "Tomorrow",
              "This",
              "Last",
              "Next",
              "Ago",
              "FromNow",
              "Now",
              "Timestamp"
            ],
            "nullable": true
          },
          "tsMomentUnit": {
            "type": "string",
            "enum": [
              "second",
              "minute",
              "hour",
              "day",
              "week",
              "month",
              "quarter",
              "year",
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "nullable": true
          },
          "tsTimestampValue": {
            "type": "string",
            "nullable": true
          },
          "tsMomentAgoFromNowQuantity": {
            "type": "number",
            "nullable": true
          },
          "tsFromMoment": {
            "nullable": true
          },
          "tsFromMomentType": {
            "type": "string",
            "enum": [
              "Literal",
              "Today",
              "Yesterday",
              "Tomorrow",
              "This",
              "Last",
              "Next",
              "Ago",
              "FromNow",
              "Now",
              "Timestamp"
            ],
            "nullable": true
          },
          "tsFromMomentUnit": {
            "type": "string",
            "enum": [
              "second",
              "minute",
              "hour",
              "day",
              "week",
              "month",
              "quarter",
              "year",
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "nullable": true
          },
          "tsFromTimestampValue": {
            "type": "string",
            "nullable": true
          },
          "tsFromMomentAgoFromNowQuantity": {
            "type": "number",
            "nullable": true
          },
          "tsToMoment": {
            "nullable": true
          },
          "tsToMomentType": {
            "type": "string",
            "enum": [
              "Literal",
              "Today",
              "Yesterday",
              "Tomorrow",
              "This",
              "Last",
              "Next",
              "Ago",
              "FromNow",
              "Now",
              "Timestamp"
            ],
            "nullable": true
          },
          "tsToMomentUnit": {
            "type": "string",
            "enum": [
              "second",
              "minute",
              "hour",
              "day",
              "week",
              "month",
              "quarter",
              "year",
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ],
            "nullable": true
          },
          "tsToTimestampValue": {
            "type": "string",
            "nullable": true
          },
          "tsToMomentAgoFromNowQuantity": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "type"
        ]
      },
      "FractionControl": {
        "type": "object",
        "properties": {
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FractionControlOption"
            },
            "nullable": true
          },
          "value": {
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "required": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string"
          },
          "controlClass": {
            "type": "string",
            "enum": [
              "list_input",
              "input",
              "switch",
              "date_picker",
              "selector"
            ]
          },
          "isMetricsDate": {
            "type": "boolean",
            "nullable": true
          }
        },
        "required": [
          "name",
          "controlClass"
        ]
      },
      "FractionSubTypeOption": {
        "type": "object",
        "properties": {
          "logicGroup": {
            "type": "string",
            "enum": [
              "OR",
              "AND_NOT"
            ],
            "nullable": true
          },
          "typeValue": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "typeValue",
          "value"
        ]
      },
      "FractionControlOption": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "value"
        ]
      }
    }
  }
}
