{
  "openapi": "3.0.0",
  "info": {
    "title": "mprove backend",
    "description": "",
    "version": "12.0.27",
    "contact": {}
  },
  "paths": {
    "/api/ToBackendPushRepo": {
      "post": {
        "operationId": "PushRepoController",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToBackendPushRepoRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToBackendPushRepoResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ToBackendPushRepoRequest": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/ToBackendPushRepoRequestInfo"
          },
          "payload": {
            "$ref": "#/components/schemas/ToBackendPushRepoRequestPayload"
          }
        },
        "required": [
          "info",
          "payload"
        ]
      },
      "ToBackendPushRepoResponse": {
        "type": "object",
        "properties": {
          "info": {
            "$ref": "#/components/schemas/ToBackendPushRepoResponseInfo"
          },
          "payload": {
            "$ref": "#/components/schemas/ToBackendPushRepoResponsePayload"
          }
        },
        "required": [
          "info",
          "payload"
        ]
      },
      "ToBackendPushRepoRequestInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "api/ToBackendPushRepo"
            ]
          },
          "traceId": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "traceId",
          "idempotencyKey"
        ]
      },
      "ToBackendPushRepoRequestPayload": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "repoId": {
            "type": "string"
          },
          "branchId": {
            "type": "string"
          },
          "envId": {
            "type": "string"
          }
        },
        "required": [
          "projectId",
          "repoId",
          "branchId",
          "envId"
        ]
      },
      "ToBackendPushRepoResponseInfo": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "enum": [
              "/api/ToBackendPushRepo"
            ]
          },
          "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"
        ]
      },
      "ToBackendPushRepoResponsePayload": {
        "type": "object",
        "properties": {
          "repo": {
            "$ref": "#/components/schemas/Repo"
          },
          "struct": {
            "$ref": "#/components/schemas/StructX"
          },
          "needValidate": {
            "type": "boolean"
          }
        },
        "required": [
          "repo",
          "struct",
          "needValidate"
        ]
      },
      "Repo": {
        "type": "object",
        "properties": {
          "orgId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "repoId": {
            "type": "string"
          },
          "currentBranchId": {
            "type": "string"
          },
          "repoStatus": {
            "type": "string",
            "enum": [
              "NeedCommit",
              "NeedPull",
              "NeedPush",
              "Ok"
            ]
          },
          "conflicts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiskFileLine"
            }
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiskCatalogNode"
            }
          },
          "changesToCommit": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiskFileChange"
            }
          },
          "changesToPush": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiskFileChange"
            }
          }
        },
        "required": [
          "orgId",
          "projectId",
          "repoId",
          "currentBranchId",
          "repoStatus",
          "conflicts",
          "nodes",
          "changesToCommit",
          "changesToPush"
        ]
      },
      "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"
        ]
      },
      "DiskFileLine": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "lineNumber": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "fileId",
          "fileName",
          "lineNumber"
        ]
      },
      "DiskCatalogNode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "isFolder": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "fileId": {
            "type": "string",
            "nullable": true
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiskCatalogNode"
            },
            "nullable": true
          }
        },
        "required": [
          "id",
          "isFolder",
          "name"
        ]
      },
      "DiskFileChange": {
        "type": "object",
        "properties": {
          "fileName": {
            "type": "string"
          },
          "fileId": {
            "type": "string"
          },
          "parentPath": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "New",
              "Deleted",
              "Modified",
              "Conflicted",
              "TypeChange",
              "Renamed",
              "Ignored",
              "Unmodified",
              "Copied",
              "Untracked",
              "Unreadable"
            ]
          },
          "content": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "fileName",
          "fileId",
          "parentPath",
          "status"
        ]
      },
      "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
          }
        }
      }
    }
  }
}
