{
  "openapi": "3.1.1",
  "info": {
    "title": "DataActApi | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://dataact.seitron.xyz"
    }
  ],
  "paths": {
    "/.well-known/data-catalog": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/ld+json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/thermostats/telemetry": {
      "get": {
        "tags": [
          "Thermostats"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiGatewayRealTimeStatus"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/thermostats/{deviceId}/history": {
      "get": {
        "tags": [
          "Thermostats"
        ],
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RawJsonTelemetry"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiGatewayRealTimeStatus": {
        "type": "object",
        "properties": {
          "gMac": {
            "type": [
              "null",
              "string"
            ]
          },
          "result": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CatalogResponse": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "publisher": {
            "$ref": "#/components/schemas/Publisher"
          },
          "homepage": {
            "type": "string"
          },
          "dataset": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DcatDataset"
            }
          },
          "distribution": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DcatDistribution"
            }
          },
          "@context": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "@id": {
            "type": "string"
          },
          "@type": {
            "type": "string"
          }
        }
      },
      "DcatDataset": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "publisher": {
            "$ref": "#/components/schemas/Publisher"
          },
          "license": {
            "type": "string"
          },
          "theme": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "distribution_refs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "@context": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "@id": {
            "type": "string"
          },
          "@type": {
            "type": "string"
          }
        }
      },
      "DcatDistribution": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string"
          },
          "accessURL": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "@context": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "@id": {
            "type": "string"
          },
          "@type": {
            "type": "string"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "Publisher": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RawJsonTelemetry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "manufacturer": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "realtimeMeasures": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "realtimeParameters": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          },
          "historicalMeasures": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "additionalProperties": {
                    "pattern": "^-?(?:0|[1-9]\\d*)$",
                    "type": [
                      "integer",
                      "string"
                    ],
                    "format": "uint16"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Catalog"
    },
    {
      "name": "Thermostats"
    }
  ]
}
