{
  "openapi": "3.0.1",
  "info": {
    "title": "AI API - Production",
    "version": "v1"
  },
  "paths": {
    "/AiApi/Ping": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/AiApi/StoreSignalsDataBatch": {
      "post": {
        "tags": [
          "AiApi"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreSignalsDataBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreSignalsDataBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/StoreSignalsDataBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetSetPoints": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetWriteSignals": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "deprecated": true
      }
    },
    "/AiApi/GetSignal": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "signalName",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/UpdateSignal": {
      "post": {
        "tags": [
          "AiApi"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSignalRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSignalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSignalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetBuilding": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/UpdateBuilding": {
      "post": {
        "tags": [
          "AiApi"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBuildingRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBuildingRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBuildingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetSignals": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetCurrentObservablesValueByBuildingId": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetMinMaxChanges": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/GetAiSettings": {
      "get": {
        "tags": [
          "AiApi"
        ],
        "parameters": [
          {
            "name": "buildingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/AiApi/UpdateAiSetting": {
      "post": {
        "tags": [
          "AiApi"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAiSettingsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAiSettingsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAiSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/LoadShift/UploadLoadShiftSignal": {
      "post": {
        "tags": [
          "LoadShift"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadLoadShiftSignalRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadLoadShiftSignalRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UploadLoadShiftSignalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/LoadShift/GetMostRecentBatch": {
      "post": {
        "tags": [
          "LoadShift"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetMostRecentLoadShiftBatchRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/GetMostRecentLoadShiftBatchRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/GetMostRecentLoadShiftBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BuildingProperties": {
        "type": "object",
        "properties": {
          "isAiActive": {
            "type": "boolean",
            "nullable": true
          },
          "temperatureFocus": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "ventilationFocus": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetMostRecentLoadShiftBatchRequest": {
        "type": "object",
        "properties": {
          "signalName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SignalProperties": {
        "type": "object",
        "properties": {
          "min": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "max": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "StoreSignal": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "signalData": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreSignalData"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "StoreSignalData": {
        "type": "object",
        "properties": {
          "dateUTC": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "StoreSignalsDataBatchRequest": {
        "type": "object",
        "properties": {
          "buildingId": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StoreSignal"
            },
            "nullable": true
          },
          "buildingDataProviderId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateAiSettingsRequest": {
        "type": "object",
        "properties": {
          "buildingId": {
            "type": "integer",
            "format": "int32"
          },
          "aiSettingId": {
            "type": "integer",
            "format": "int32"
          },
          "value": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "UpdateBuildingRequest": {
        "type": "object",
        "properties": {
          "buildingId": {
            "type": "integer",
            "format": "int32"
          },
          "update": {
            "$ref": "#/components/schemas/BuildingProperties"
          }
        },
        "additionalProperties": false
      },
      "UpdateSignalRequest": {
        "type": "object",
        "properties": {
          "buildingId": {
            "type": "integer",
            "format": "int32"
          },
          "signalId": {
            "type": "integer",
            "format": "int32"
          },
          "update": {
            "$ref": "#/components/schemas/SignalProperties"
          }
        },
        "additionalProperties": false
      },
      "UploadLoadShiftSignalDataPoint": {
        "type": "object",
        "properties": {
          "timestampUtc": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double",
              "nullable": true
            },
            "nullable": true,
            "deprecated": true
          }
        },
        "additionalProperties": false
      },
      "UploadLoadShiftSignalRequest": {
        "type": "object",
        "properties": {
          "signalName": {
            "type": "string",
            "nullable": true
          },
          "dataPoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UploadLoadShiftSignalDataPoint"
            },
            "nullable": true
          },
          "batchTimestampUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}