{
  "openapi": "3.0.0",
  "info": {
    "title": "mprove backend",
    "description": "",
    "version": "12.0.27",
    "contact": {}
  },
  "paths": {
    "/api/ToBackendGetCharts": {
      "post": {
        "operationId": "GetChartsController",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToBackendGetChartsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToBackendGetChartsResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ToBackendGetChartsRequest": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/ToBackendGetChartsRequestInfo"
          },
          "payload": {
            "$ref": "#/components/schemas/ToBackendGetChartsRequestPayload"
          }
        },
        "required": [
          "info",
          "payload"
        ]
      },
      "ToBackendGetChartsResponse": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/ToBackendGetChartsResponseInfo"
          },
          "payload": {
            "$ref": "#/components/schemas/ToBackendGetChartsResponsePayload"
          }
        },
        "required": [
          "info",
          "payload"
        ]
      },
      "ToBackendGetChartsRequestInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "api/ToBackendGetCharts"
            ]
          },
          "traceId": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "traceId",
          "idempotencyKey"
        ]
      },
      "ToBackendGetChartsRequestPayload": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "repoId": {
            "type": "string"
          },
          "branchId": {
            "type": "string"
          },
          "envId": {
            "type": "string"
          }
        },
        "required": [
          "projectId",
          "repoId",
          "branchId",
          "envId"
        ]
      },
      "ToBackendGetChartsResponseInfo": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "enum": [
              "/api/ToBackendGetCharts"
            ]
          },
          "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"
        ]
      },
      "ToBackendGetChartsResponsePayload": {
        "type": "object",
        "properties": {
          "needValidate": {
            "type": "boolean"
          },
          "struct": {
            "$ref": "#/components/schemas/StructX"
          },
          "userMember": {
            "$ref": "#/components/schemas/Member"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelX"
            }
          },
          "chartUnitDrafts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChartUnit"
            }
          },
          "chartSpaceNodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToBackendGetChartsResponse__schema0"
            }
          }
        },
        "required": [
          "needValidate",
          "struct",
          "userMember",
          "models",
          "chartUnitDrafts",
          "chartSpaceNodes"
        ]
      },
      "StructX": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "structId": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BmlError"
            }
          },
          "modelFilePaths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelMetricX"
            }
          },
          "presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Preset"
            }
          },
          "spaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Space"
            }
          },
          "mproveConfig": {
            "$ref": "#/components/schemas/MproveConfig"
          },
          "mproveExplorer": {
            "type": "string",
            "nullable": true
          },
          "mproveVersion": {
            "type": "string"
          },
          "serverTs": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "projectId",
          "structId",
          "errors",
          "modelFilePaths",
          "metrics",
          "presets",
          "spaces",
          "mproveConfig",
          "mproveVersion",
          "serverTs"
        ]
      },
      "Member": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "memberId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "avatarSmall": {
            "type": "string"
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isAdmin": {
            "type": "boolean"
          },
          "isEditor": {
            "type": "boolean"
          },
          "isExplorer": {
            "type": "boolean"
          },
          "serverTs": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "projectId",
          "memberId",
          "email",
          "alias",
          "firstName",
          "lastName",
          "fullName",
          "avatarSmall",
          "roles",
          "isAdmin",
          "isEditor",
          "isExplorer",
          "serverTs"
        ]
      },
      "ModelX": {
        "type": "object",
        "properties": {
          "structId": {
            "type": "string"
          },
          "modelId": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "Store",
              "Malloy"
            ]
          },
          "source": {
            "type": "string",
            "nullable": true
          },
          "connectionId": {
            "type": "string"
          },
          "connectionType": {
            "type": "string",
            "enum": [
              "PostgreSQL",
              "MySQL",
              "SnowFlake",
              "BigQuery",
              "Databricks",
              "MotherDuck",
              "Presto",
              "Trino",
              "GoogleApi",
              "Api"
            ]
          },
          "filePath": {
            "type": "string"
          },
          "space": {
            "type": "string",
            "nullable": true
          },
          "spaceFullTitle": {
            "type": "string"
          },
          "fileText": {
            "type": "string"
          },
          "storeContent": {},
          "dateRangeIncludesRightSide": {
            "type": "boolean"
          },
          "accessRoles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessRolesCombined": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string"
                },
                "isDirect": {
                  "type": "boolean"
                }
              },
              "required": [
                "role",
                "isDirect"
              ]
            }
          },
          "label": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelField"
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelNode"
            }
          },
          "malloyModelDef": {},
          "serverTs": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "hasAccess": {
            "type": "boolean"
          }
        },
        "required": [
          "structId",
          "modelId",
          "type",
          "connectionId",
          "connectionType",
          "filePath",
          "spaceFullTitle",
          "fileText",
          "storeContent",
          "dateRangeIncludesRightSide",
          "accessRoles",
          "accessRolesCombined",
          "label",
          "fields",
          "nodes",
          "malloyModelDef",
          "serverTs",
          "hasAccess"
        ]
      },
      "ChartUnit": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "chartUnit"
            ]
          },
          "id": {
            "type": "string"
          },
          "chartId": {
            "type": "string"
          },
          "modelId": {
            "type": "string"
          },
          "modelLabel": {
            "type": "string"
          },
          "chartType": {
            "type": "string",
            "enum": [
              "table",
              "line",
              "bar",
              "scatter",
              "pie",
              "single",
              "pivot_table"
            ]
          },
          "iconPath": {
            "type": "string",
            "nullable": true
          },
          "draft": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "filePath": {
            "type": "string",
            "nullable": true
          },
          "space": {
            "type": "string",
            "nullable": true
          },
          "accessRoles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessRolesCombined": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string"
                },
                "isDirect": {
                  "type": "boolean"
                }
              },
              "required": [
                "role",
                "isDirect"
              ]
            }
          },
          "author": {
            "type": "string",
            "nullable": true
          },
          "canEditOrDeleteChart": {
            "type": "boolean"
          },
          "isFavorite": {
            "type": "boolean"
          },
          "spaceFullTitle": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "chartId",
          "modelId",
          "modelLabel",
          "chartType",
          "draft",
          "title",
          "accessRoles",
          "accessRolesCombined",
          "canEditOrDeleteChart",
          "isFavorite",
          "spaceFullTitle"
        ]
      },
      "ToBackendGetChartsResponse__schema0": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "spaceFolder"
                ]
              },
              "id": {
                "type": "string"
              },
              "space": {
                "type": "string"
              },
              "filePath": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "accessRoles": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "accessRolesCombined": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "isDirect": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "role",
                    "isDirect"
                  ]
                }
              },
              "isSynthetic": {
                "type": "boolean"
              },
              "modelId": {
                "type": "string",
                "nullable": true
              },
              "modelLabel": {
                "type": "string",
                "nullable": true
              },
              "children": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ToBackendGetChartsResponse__schema0"
                }
              }
            },
            "required": [
              "type",
              "id",
              "space",
              "filePath",
              "title",
              "accessRoles",
              "accessRolesCombined",
              "isSynthetic",
              "children"
            ]
          },
          {
            "$ref": "#/components/schemas/SpaceUnit"
          }
        ]
      },
      "BmlError": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiskFileLine"
            }
          }
        },
        "required": [
          "title",
          "message",
          "lines"
        ]
      },
      "ModelMetricX": {
        "type": "object",
        "properties": {
          "modelId": {
            "type": "string",
            "nullable": true
          },
          "modelType": {
            "type": "string",
            "enum": [
              "Store",
              "Malloy"
            ]
          },
          "connectionType": {
            "type": "string",
            "enum": [
              "PostgreSQL",
              "MySQL",
              "SnowFlake",
              "BigQuery",
              "Databricks",
              "MotherDuck",
              "Presto",
              "Trino",
              "GoogleApi",
              "Api"
            ]
          },
          "fieldId": {
            "type": "string"
          },
          "fieldClass": {
            "type": "string",
            "enum": [
              "dimension",
              "time",
              "measure",
              "calculation",
              "filter",
              "join",
              "info"
            ]
          },
          "fieldResult": {
            "type": "string",
            "enum": [
              "day_of_week",
              "day_of_week_index",
              "month_name",
              "quarter_of_year",
              "ts",
              "yesno",
              "string",
              "number",
              "date",
              "boolean",
              "array",
              "record",
              "json",
              "sql_native"
            ],
            "nullable": true
          },
          "timeFieldId": {
            "type": "string"
          },
          "structId": {
            "type": "string"
          },
          "filePath": {
            "type": "string",
            "nullable": true
          },
          "fieldLineNum": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "nullable": true
          },
          "type": {
            "type": "string",
            "enum": [
              "Model"
            ]
          },
          "metricId": {
            "type": "string"
          },
          "topNode": {
            "type": "string",
            "nullable": true
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "topLabel": {
            "type": "string",
            "nullable": true
          },
          "partNodeLabel": {
            "type": "string",
            "nullable": true
          },
          "partFieldLabel": {
            "type": "string",
            "nullable": true
          },
          "partLabel": {
            "type": "string",
            "nullable": true
          },
          "timeNodeLabel": {
            "type": "string",
            "nullable": true
          },
          "timeFieldLabel": {
            "type": "string",
            "nullable": true
          },
          "timeLabel": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "formatNumber": {
            "type": "string",
            "nullable": true
          },
          "currencyPrefix": {
            "type": "string",
            "nullable": true
          },
          "currencySuffix": {
            "type": "string",
            "nullable": true
          },
          "serverTs": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "hasAccessToModel": {
            "type": "boolean"
          }
        },
        "required": [
          "modelType",
          "connectionType",
          "fieldId",
          "fieldClass",
          "timeFieldId",
          "structId",
          "type",
          "metricId",
          "serverTs",
          "hasAccessToModel"
        ]
      },
      "Preset": {
        "type": "object",
        "properties": {
          "presetId": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "parsedContent": {}
        },
        "required": [
          "presetId",
          "label",
          "path",
          "parsedContent"
        ]
      },
      "Space": {
        "type": "object",
        "properties": {
          "space": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "fullTitle": {
            "type": "string"
          },
          "filePath": {
            "type": "string"
          },
          "accessRoles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessRolesCombined": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string"
                },
                "isDirect": {
                  "type": "boolean"
                }
              },
              "required": [
                "role",
                "isDirect"
              ]
            }
          }
        },
        "required": [
          "space",
          "fullTitle",
          "filePath",
          "accessRoles",
          "accessRolesCombined"
        ]
      },
      "MproveConfig": {
        "type": "object",
        "properties": {
          "mproveDirValue": {
            "type": "string",
            "nullable": true
          },
          "caseSensitiveStringFilters": {
            "type": "boolean",
            "nullable": true
          },
          "weekStart": {
            "type": "string",
            "enum": [
              "Sunday",
              "Monday"
            ],
            "nullable": true
          },
          "allowTimezones": {
            "type": "boolean",
            "nullable": true
          },
          "defaultTimezone": {
            "type": "string",
            "nullable": true
          },
          "formatNumber": {
            "type": "string",
            "nullable": true
          },
          "currencyPrefix": {
            "type": "string",
            "nullable": true
          },
          "currencySuffix": {
            "type": "string",
            "nullable": true
          },
          "thousandsSeparator": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ModelField": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "malloyFieldName": {
            "type": "string",
            "nullable": true
          },
          "malloyFieldPath": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "malloyBaseFieldId": {
            "type": "string",
            "nullable": true
          },
          "malloyTags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            },
            "nullable": true
          },
          "mproveTags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValuePair"
            },
            "nullable": true
          },
          "hidden": {
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          },
          "maxFractions": {
            "type": "number",
            "nullable": true
          },
          "label": {
            "type": "string"
          },
          "fieldClass": {
            "type": "string",
            "enum": [
              "dimension",
              "time",
              "measure",
              "calculation",
              "filter",
              "join",
              "info"
            ]
          },
          "fieldFileName": {
            "type": "string",
            "nullable": true
          },
          "fieldFilePath": {
            "type": "string",
            "nullable": true
          },
          "result": {
            "type": "string",
            "enum": [
              "day_of_week",
              "day_of_week_index",
              "month_name",
              "quarter_of_year",
              "ts",
              "yesno",
              "string",
              "number",
              "date",
              "boolean",
              "array",
              "record",
              "json",
              "sql_native"
            ],
            "nullable": true
          },
          "fieldLineNum": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "nullable": true
          },
          "suggestModelDimension": {
            "type": "string",
            "nullable": true
          },
          "sqlName": {
            "type": "string"
          },
          "topId": {
            "type": "string"
          },
          "topLabel": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "enum": [
              "count_distinct",
              "sum",
              "sum_by_key",
              "average",
              "average_by_key",
              "median_by_key",
              "percentile_by_key",
              "min",
              "max",
              "list",
              "custom",
              "yesno_is_true"
            ],
            "nullable": true
          },
          "groupId": {
            "type": "string",
            "nullable": true
          },
          "groupLabel": {
            "type": "string",
            "nullable": true
          },
          "groupDescription": {
            "type": "string",
            "nullable": true
          },
          "formatNumber": {
            "type": "string",
            "nullable": true
          },
          "currencyPrefix": {
            "type": "string",
            "nullable": true
          },
          "currencySuffix": {
            "type": "string",
            "nullable": true
          },
          "buildMetrics": {
            "type": "boolean",
            "nullable": true
          },
          "isTimeframeBase": {
            "type": "boolean"
          },
          "timeframe": {
            "type": "string",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "enum": [
              "timestamps",
              "minutes",
              "hours",
              "days",
              "weeksSunday",
              "weeksMonday",
              "months",
              "quarters",
              "years"
            ],
            "nullable": true
          }
        },
        "required": [
          "id",
          "hidden",
          "required",
          "label",
          "fieldClass",
          "sqlName",
          "topId",
          "topLabel",
          "isTimeframeBase"
        ]
      },
      "ModelNode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "nodeClass": {
            "type": "string",
            "enum": [
              "dimension",
              "time",
              "measure",
              "calculation",
              "filter",
              "join",
              "info"
            ]
          },
          "viewName": {
            "type": "string",
            "nullable": true
          },
          "isField": {
            "type": "boolean"
          },
          "fieldFileName": {
            "type": "string",
            "nullable": true
          },
          "viewFilePath": {
            "type": "string",
            "nullable": true
          },
          "fieldFilePath": {
            "type": "string",
            "nullable": true
          },
          "fieldResult": {
            "type": "string",
            "enum": [
              "day_of_week",
              "day_of_week_index",
              "month_name",
              "quarter_of_year",
              "ts",
              "yesno",
              "string",
              "number",
              "date",
              "boolean",
              "array",
              "record",
              "json",
              "sql_native"
            ],
            "nullable": true
          },
          "fieldLineNum": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "nullable": true
          },
          "hidden": {
            "type": "boolean"
          },
          "required": {
            "type": "boolean"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelNode"
            },
            "nullable": true
          }
        },
        "required": [
          "id",
          "label",
          "nodeClass",
          "isField",
          "hidden",
          "required"
        ]
      },
      "SpaceUnit": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "spaceUnit"
            ]
          },
          "id": {
            "type": "string"
          },
          "unitId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "filePath": {
            "type": "string",
            "nullable": true
          },
          "space": {
            "type": "string",
            "nullable": true
          },
          "accessRoles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessRolesCombined": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string"
                },
                "isDirect": {
                  "type": "boolean"
                }
              },
              "required": [
                "role",
                "isDirect"
              ]
            }
          },
          "author": {
            "type": "string",
            "nullable": true
          },
          "canEditOrDeleteUnit": {
            "type": "boolean"
          },
          "isFavorite": {
            "type": "boolean"
          },
          "spaceFullTitle": {
            "type": "string"
          },
          "modelId": {
            "type": "string",
            "nullable": true
          },
          "modelLabel": {
            "type": "string",
            "nullable": true
          },
          "chartType": {
            "type": "string",
            "enum": [
              "table",
              "line",
              "bar",
              "scatter",
              "pie",
              "single",
              "pivot_table"
            ],
            "nullable": true
          },
          "iconPath": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "type",
          "id",
          "unitId",
          "title",
          "accessRoles",
          "accessRolesCombined",
          "canEditOrDeleteUnit",
          "isFavorite",
          "spaceFullTitle"
        ]
      },
      "DiskFileLine": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "lineNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "fileId",
          "fileName",
          "lineNumber"
        ]
      },
      "KeyValuePair": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "key"
        ]
      }
    }
  }
}
