{
  "x-generator": "NSwag v14.6.3.0 (NJsonSchema v11.5.2.0 (Newtonsoft.Json v13.0.0.0))",
  "swagger": "2.0",
  "info": {
    "title": "Senmo API",
    "description": "Senmo Public API v1",
    "version": "v1"
  },
  "host": "api.senmo.nl",
  "schemes": [
    "https"
  ],
  "paths": {
    "/Account/authenticate": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Authenticates a user by email and password and returns a JWT token when successful.",
        "operationId": "Account_Authenticate",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The credentials payload containing the email and password.",
            "schema": {
              "$ref": "#/definitions/AuthenticationRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "x-nullable": false,
            "description": "An ActionResult`1 that includes the authentication response on success or a 401 status code on failure.",
            "schema": {
              "$ref": "#/definitions/AuthenticationResponse"
            }
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          }
        }
      }
    },
    "/Account/apikey": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Authenticates an integration using an API key and issues a JWT token.",
        "operationId": "Account_AuthenticateApiKey",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The API key payload used for authentication.",
            "schema": {
              "$ref": "#/definitions/ApiKeyAuthenticationRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "x-nullable": false,
            "description": "An ActionResult`1 with the authentication response or a 401 status code when the key is invalid.",
            "schema": {
              "$ref": "#/definitions/AuthenticationResponse"
            }
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          }
        }
      }
    },
    "/Account/send-email-confirmation": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Sends an email confirmation link to the specified user.",
        "operationId": "Account_SendEmailConfirmation",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The email address that should receive the confirmation link.",
            "schema": {
              "$ref": "#/definitions/EmailAddressRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the email was sent or 400 when the operation fails."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/confirm-email": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Confirms a user's email address using the provided token.",
        "operationId": "Account_ConfirmEmail",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The email confirmation payload containing the token and email.",
            "schema": {
              "$ref": "#/definitions/ConfirmEmailRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the email is confirmed or 400 if validation fails."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/resend-confirmation": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Resends the email confirmation message to a user.",
        "operationId": "Account_ResendEmailConfirmation",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The payload containing the email that should receive the confirmation.",
            "schema": {
              "$ref": "#/definitions/ResendEmailConfirmationRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the message is queued or 400 when the request is invalid."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/send-phone-code": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Sends a verification code to the provided phone number.",
        "operationId": "Account_SendPhoneCode",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The payload that contains the email and phone number.",
            "schema": {
              "$ref": "#/definitions/SendPhoneCodeRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the code is sent or 400 if the request fails validation."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/verify-phone": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Verifies the previously issued phone code for the user.",
        "operationId": "Account_VerifyPhone",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The verification payload containing email, phone number, and the code.",
            "schema": {
              "$ref": "#/definitions/VerifyPhoneRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the phone is verified or 400 if the verification fails."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/change-password": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Changes the password for an authenticated user.",
        "operationId": "Account_ChangePassword",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The payload containing the current and new password values.",
            "schema": {
              "$ref": "#/definitions/ChangePasswordRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 on success or 400 when the request is invalid."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/forgot-password": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Initiates the forgot password flow by sending a reset link.",
        "operationId": "Account_ForgotPassword",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The payload containing the email address of the user.",
            "schema": {
              "$ref": "#/definitions/ForgotPasswordRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the reset link is issued or 400 if validation fails."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Account/reset-password": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Completes the password reset using the provided token and new password.",
        "operationId": "Account_ResetPassword",
        "consumes": [
          "application/json",
          "application/*+json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "required": true,
            "description": "The payload containing email, token, and the desired new password.",
            "schema": {
              "$ref": "#/definitions/ResetPasswordRequest"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "200": {
            "description": "Returns 200 when the password is reset or 400 if the token or inputs are invalid."
          },
          "429": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "500": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/AppData/{key}": {
      "get": {
        "tags": [
          "AppData"
        ],
        "summary": "Gets an app data record by key for the current customer's scope.",
        "operationId": "GetAppData",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "key",
            "in": "path",
            "required": true,
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "entityType",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "entityId",
            "in": "query",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/AppDataDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "put": {
        "tags": [
          "AppData"
        ],
        "summary": "Creates or updates an app data record for the current customer's scope.",
        "operationId": "UpsertAppData",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "key",
            "in": "path",
            "required": true,
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpsertAppDataCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/AppDataDto"
            }
          }
        }
      }
    },
    "/calendarcategories": {
      "get": {
        "tags": [
          "Calendar Categories"
        ],
        "operationId": "GetCalendarCategories",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarCategoryDto"
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Calendar Categories"
        ],
        "operationId": "UpsertCalendarCategories",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "categories",
            "in": "body",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarCategoryDto"
              }
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarCategoryDto"
              }
            }
          }
        }
      }
    },
    "/Calendars": {
      "get": {
        "tags": [
          "Calendar Events"
        ],
        "summary": "Returns calendar events filtered by location, date range, and type/status.",
        "operationId": "GetCalendars",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "contactId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "fromDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "tillDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "search",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "type",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "state",
            "in": "query",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarEventDto"
              }
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Calendar Events"
        ],
        "summary": "Creates a new calendar event for the current customer.",
        "operationId": "CreateCalendar",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCalendarItemCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Calendars/{id}": {
      "get": {
        "tags": [
          "Calendar Events"
        ],
        "summary": "Returns a single calendar event by its UID.",
        "operationId": "GetCalendarById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/CalendarEventDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Calendar Events"
        ],
        "summary": "Updates an existing calendar event.",
        "operationId": "UpdateCalendar",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateCalendarItemCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Calendar Events"
        ],
        "summary": "Soft-deletes a calendar event.",
        "operationId": "DeleteCalendar",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/calendarstatuses": {
      "get": {
        "tags": [
          "Calendar Statuses"
        ],
        "operationId": "GetCalendarStatuses",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarStatusDto"
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Calendar Statuses"
        ],
        "operationId": "UpsertCalendarStatuses",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "statuses",
            "in": "body",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarStatusDto"
              }
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarStatusDto"
              }
            }
          }
        }
      }
    },
    "/calendartypes": {
      "get": {
        "tags": [
          "Calendar Types"
        ],
        "operationId": "GetCalendarTypes",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarTypeDto"
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Calendar Types"
        ],
        "operationId": "UpsertCalendarTypes",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "types",
            "in": "body",
            "required": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarTypeDto"
              }
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CalendarTypeDto"
              }
            }
          }
        }
      }
    },
    "/Charts/aggregated": {
      "get": {
        "tags": [
          "Charts"
        ],
        "summary": "Get chart data for sensor by period.",
        "description": "Measurements are aggregated by period",
        "operationId": "GetAggregatedByPeriod",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "SensorId",
            "in": "query",
            "description": "Gets or sets the sensor ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "description": "Gets or sets the sub-location ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "description": "Gets or sets the sub-location ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "From",
            "in": "query",
            "description": "Gets or sets the start date for the query.",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Till",
            "in": "query",
            "description": "Gets or sets the end date for the query.",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Aggregate",
            "in": "query",
            "description": "Gets or sets the aggregation type.",
            "x-schema": {
              "$ref": "#/definitions/Aggregate"
            },
            "x-nullable": false,
            "enum": [
              "Avg",
              "Min",
              "Max"
            ]
          },
          {
            "type": "string",
            "name": "TimePeriod",
            "in": "query",
            "description": "Gets or sets the time period for the query.",
            "x-schema": {
              "$ref": "#/definitions/TimePeriod"
            },
            "x-nullable": false,
            "enum": [
              "C",
              "D",
              "W",
              "M",
              "Y"
            ]
          },
          {
            "type": "integer",
            "name": "Interval",
            "in": "query",
            "description": "Gets or sets the interval for the data.",
            "format": "int32",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Granularity",
            "in": "query",
            "description": "Gets or sets the granularity of the data.",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorClassId",
            "in": "query",
            "description": "Gets or sets the SensorclassId",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ChartSeriesDto"
              }
            }
          }
        }
      }
    },
    "/ContactRoles": {
      "get": {
        "tags": [
          "ContactRoles"
        ],
        "summary": "Lists all contact roles for the current customer.",
        "operationId": "GetContactRoles",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ContactRoleDto"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ContactRoles"
        ],
        "summary": "Creates a new contact role.",
        "operationId": "CreateContactRole",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateContactRoleCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ContactRoleDto"
            }
          }
        }
      }
    },
    "/ContactRoles/{id}": {
      "get": {
        "tags": [
          "ContactRoles"
        ],
        "summary": "Gets a contact role by id.",
        "operationId": "GetContactRoleById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ContactRoleDto"
            }
          }
        }
      },
      "put": {
        "tags": [
          "ContactRoles"
        ],
        "summary": "Updates an existing contact role.",
        "operationId": "UpdateContactRole",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateContactRoleCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ContactRoleDto"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "ContactRoles"
        ],
        "summary": "Deletes a contact role.",
        "operationId": "DeleteContactRole",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        }
      }
    },
    "/Contacts/customer/{customerId}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Returns contacts for a customer with paging and search.",
        "operationId": "GetContactsByCustomer",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "PageIndex",
            "in": "query",
            "description": "Page index. First page starts at index 1.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "PageSize",
            "in": "query",
            "description": "Amount of items to return per page. Default is 100.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Search",
            "in": "query",
            "description": "Search query parameter.",
            "maxLength": 50,
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/PagedResponseOfContactDto"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Creates a contact for the specified customer.",
        "operationId": "CreateContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateContactCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Contacts/customer/{customerId}/{contactId}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Returns a single contact for the given customer.",
        "operationId": "GetContactById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "contactId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ContactDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Contacts"
        ],
        "summary": "Updates a contact for the specified customer.",
        "operationId": "UpdateContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "contactId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateContactCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ContactDto"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Deletes (soft) a contact for the specified customer.",
        "operationId": "DeleteContact",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "contactId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Contacts/customer/{customerId}/{contactId}/avatar": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Uploads or replaces a contact avatar (stored in the UserAvatars media group).",
        "operationId": "UploadContactAvatar",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "contactId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "ContentType",
            "in": "formData",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "ContentDisposition",
            "in": "formData",
            "x-nullable": false
          },
          {
            "type": "array",
            "name": "Headers",
            "in": "formData",
            "collectionFormat": "multi",
            "x-nullable": false,
            "items": {
              "additionalProperties": {}
            }
          },
          {
            "type": "integer",
            "name": "Length",
            "in": "formData",
            "format": "int64",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Name",
            "in": "formData",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "FileName",
            "in": "formData",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/MediaInfoDto"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact avatar (stored in the UserAvatars media group).",
        "operationId": "DeleteContactAvatar",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "contactId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/MediaInfoDto"
            }
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "401": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Customer/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get customer by id.",
        "description": "Get a specific customer by its id.",
        "operationId": "GetCustomerById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Customer id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/GetCustomerQueryResponse"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "description": "Delete customer by id. Only possible when no other related data exists. Check response for result message.",
        "operationId": "DeleteCustomer",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/DeleteCustomerCommandResponse"
            }
          }
        }
      }
    },
    "/Customer": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List available Customers.",
        "description": "Get a list of all customer part of current users tenant.",
        "operationId": "GetAllCustomers",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/GetCustomersQueryResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a new customer",
        "description": "Create a new customer. Assigned to the current users tenant.",
        "operationId": "CreateCustomer",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "createCustomerCommand",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateCustomerCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/CreateCustomerCommandResponse"
            }
          }
        }
      }
    },
    "/Device/tts/DevEui": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get device by TTS devEui.",
        "operationId": "GetDeviceInfoByTTSEui",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "tenant",
            "in": "query",
            "description": "The tenant ID",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "application",
            "in": "query",
            "description": "The application name",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "devEui",
            "in": "query",
            "description": "The device EUI",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the device information",
            "schema": {
              "$ref": "#/definitions/DeviceInfoDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "If the device is not found",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Device/tts/DeviceId": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get device by TTS deviceID.",
        "operationId": "GetDeviceInfoByTTSDeviceId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "tenant",
            "in": "query",
            "description": "The tenant ID",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "application",
            "in": "query",
            "description": "The application name",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "deviceId",
            "in": "query",
            "description": "The device ID",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the device information",
            "schema": {
              "$ref": "#/definitions/DeviceInfoDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "If the device is not found",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Device/{deviceId}": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get device y Id.",
        "operationId": "GetDeviceById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "deviceId",
            "in": "path",
            "required": true,
            "description": "The device ID",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the device ",
            "schema": {
              "$ref": "#/definitions/DeviceInfoDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "If the device is not found",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Device/{deviceId}/info": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get device info by Id.",
        "operationId": "GetDeviceInfoById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "deviceId",
            "in": "path",
            "required": true,
            "description": "The device ID",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the device information",
            "schema": {
              "$ref": "#/definitions/DeviceInfoDto"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "If the device is not found",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "Update device info.",
        "operationId": "UpdateDeviceInfo",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "deviceId",
            "in": "path",
            "required": true,
            "description": "The device ID",
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "The update command",
            "schema": {
              "$ref": "#/definitions/UpdateDeviceInfoCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully updated the device info"
          }
        }
      }
    },
    "/Device/Sensor/{sensorId}": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "Update device sensor.",
        "operationId": "UpdateSensor",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "sensorId",
            "in": "path",
            "required": true,
            "description": "The sensor ID",
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "The update command",
            "schema": {
              "$ref": "#/definitions/UpdateSensorInfoQuery"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully updated the sensor"
          }
        }
      }
    },
    "/Device/Customer/{customerId}": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get devices by customer.",
        "operationId": "GetDevicesByCustomer",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "description": "The customreId ID",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "description": "Gets or sets the customer ID.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "description": "Filter devices by Location ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "description": "Filter devices by sublocation",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "DeviceId",
            "in": "query",
            "description": "Filter devices by sublocation",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorClassIds",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "AlertsOnly",
            "in": "query",
            "description": "Gets or sets a value indicating whether to filter by alerts only.",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "PageIndex",
            "in": "query",
            "description": "Page index. First page starts at index 1.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "PageSize",
            "in": "query",
            "description": "Amount of items to return per page. Default is 100.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Search",
            "in": "query",
            "description": "Search query parameter.",
            "maxLength": 50,
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the list of devices",
            "schema": {
              "$ref": "#/definitions/GetDevicesQueryResponse"
            }
          }
        }
      }
    },
    "/Device/Customer/{customerId}/Batterystates": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get device battery statuses by customer.",
        "operationId": "GetDeviceBatteryStatuses",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "description": "The ID of the customer",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "array",
            "name": "locationIds",
            "in": "query",
            "description": "Optional array of location IDs to filter the battery statuses",
            "collectionFormat": "multi",
            "x-nullable": true,
            "items": {
              "type": "string",
              "format": "guid"
            }
          },
          {
            "type": "array",
            "name": "sublocationIds",
            "in": "query",
            "description": "Optional array of sublocation IDs to filter the battery statuses",
            "collectionFormat": "multi",
            "x-nullable": true,
            "items": {
              "type": "string",
              "format": "guid"
            }
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the list of device battery statuses",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/DeviceBatteryStateDto"
              }
            }
          }
        }
      }
    },
    "/Device/Sublocation/{sublocationId}": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get devices by sublocation.",
        "operationId": "Device_GetBySubLocationId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "sublocationId",
            "in": "path",
            "required": true,
            "description": "The sublocation ID",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Returns the list of devices",
            "schema": {
              "$ref": "#/definitions/GetDevicesQueryResponse"
            }
          }
        }
      }
    },
    "/Device/{deviceId}/edit": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Get device edit info (device, locations, sensors).",
        "operationId": "Device_GetEdit",
        "parameters": [
          {
            "type": "string",
            "name": "deviceId",
            "in": "path",
            "required": true,
            "description": "The device ID",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the device edit information"
          }
        }
      }
    },
    "/Device/{deviceId}/command/{commandCode}": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "Send command to device.",
        "operationId": "Device_SendCommand",
        "parameters": [
          {
            "type": "string",
            "name": "deviceId",
            "in": "path",
            "required": true,
            "description": "The device ID",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "commandCode",
            "in": "path",
            "required": true,
            "description": "The command code",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully sent the command to the device"
          }
        }
      }
    },
    "/DeviceType": {
      "get": {
        "tags": [
          "Device Types"
        ],
        "summary": "List available Device types.",
        "operationId": "GetAllDeviceTypes",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/GetDeviceTypesQueryResponse"
            }
          }
        }
      }
    },
    "/DeviceType/{deviceTypeUId}": {
      "get": {
        "tags": [
          "Device Types"
        ],
        "summary": "Get a device type by id.",
        "operationId": "GetDeviceTypByUId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "deviceTypeUId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/DeviceTypeDto"
            }
          }
        }
      }
    },
    "/Media/{id}": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "Retrieves the file content for a specific media item by its ID.",
        "operationId": "Media_GetImage",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the media item.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Id",
            "in": "query",
            "description": "The identifier of the media to retrieve.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "MediaGroup",
            "in": "query",
            "description": "The name of the media group.",
            "x-nullable": true
          }
        ],
        "responses": {
          "204": {
            "description": "Returns the media file if found; otherwise, returns HTTP 204 No Content."
          }
        }
      }
    },
    "/Media/devicetype/{id}": {
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "Retrieves the file content for a specific device type media item by its ID.",
        "operationId": "Media_GetDeviceTypeImage",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the device type media item.",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": "Returns the media file if found; otherwise, returns HTTP 204 No Content."
          }
        }
      }
    },
    "/Media/{customerId}/{mediaGroup}": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Upload a new media file for a customer and media group.",
        "operationId": "Media_UploadMedia",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "description": "Customer UID.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "mediaGroup",
            "in": "path",
            "required": true,
            "description": "Media group name.",
            "x-nullable": false
          },
          {
            "name": "payload",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MediaContentDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/MediaInfoDto"
            }
          }
        }
      }
    },
    "/Media/{customerId}/{mediaGroup}/{id}": {
      "put": {
        "tags": [
          "Media"
        ],
        "summary": "Replace existing media content/metadata.",
        "operationId": "Media_UpdateMedia",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "description": "Customer UID.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "mediaGroup",
            "in": "path",
            "required": true,
            "description": "Media group name.",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Media UID.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "payload",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/MediaContentDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/MediaInfoDto"
            }
          }
        }
      }
    },
    "/Locations/customer/{customerId}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets all locations for a specific customer.",
        "operationId": "GetLocationsByCustomer",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "array",
            "name": "SensorClassIds",
            "in": "query",
            "collectionFormat": "multi",
            "x-nullable": true,
            "items": {
              "type": "string"
            }
          },
          {
            "type": "array",
            "name": "UtilityTypes",
            "in": "query",
            "collectionFormat": "multi",
            "x-nullable": true,
            "items": {
              "$ref": "#/definitions/UtilityType"
            }
          },
          {
            "type": "integer",
            "name": "PageIndex",
            "in": "query",
            "description": "Page index. First page starts at index 1.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "PageSize",
            "in": "query",
            "description": "Amount of items to return per page. Default is 100.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Search",
            "in": "query",
            "description": "Search query parameter.",
            "maxLength": 50,
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/PagedResponseOfLocationDto"
            }
          }
        }
      }
    },
    "/Locations/{locationId}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets a location by its unique identifier.",
        "operationId": "GetLocationsById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "description": "Location Id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/LocationDto"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Updates an existing location.",
        "operationId": "UpdateLocation",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateLocationCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        }
      },
      "delete": {
        "tags": [
          "Locations"
        ],
        "summary": "Soft deletes a location.",
        "operationId": "DeleteLocation",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        }
      }
    },
    "/Locations/{locationId}/Status": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets the status of a location by its unique identifier.",
        "operationId": "GetLocationStatusById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "description": "Location Id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/StatusDto"
            }
          }
        }
      }
    },
    "/Locations/{id}/status": {
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Updates the status of a location.",
        "operationId": "UpdateLocationStatus",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SetLocationStatusCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Locations": {
      "post": {
        "tags": [
          "Locations"
        ],
        "summary": "Creates a new location.",
        "operationId": "CreateLocation",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateLocationCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/CreateLocationCommandResponse"
            }
          }
        }
      }
    },
    "/Locations/{locationId}/contacts": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets contacts assigned to a location with their roles.",
        "operationId": "GetLocationContacts",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LocationContactDto"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Locations"
        ],
        "summary": "Adds a contact to a location with a specific role.",
        "operationId": "CreateLocationContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateLocationContactCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/LocationContactDto"
            }
          }
        }
      }
    },
    "/Locations/{locationId}/contacts/{id}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets a specific contact assignment for a location.",
        "operationId": "GetLocationContactById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/LocationContactDto"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Locations"
        ],
        "summary": "Updates a contact assignment for a location.",
        "operationId": "UpdateLocationContact",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateLocationContactCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/LocationContactDto"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Locations"
        ],
        "summary": "Deletes a contact assignment from a location.",
        "operationId": "DeleteLocationContact",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        }
      }
    },
    "/Locations/{locationId}/imagemeta/{imageId}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets image metadata for a specific image of a location.",
        "operationId": "GetLocationImageMeta",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "imageId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Locations/{locationId}/imagemetas": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets all image metadata for a location.",
        "operationId": "GetLocationImageMetas",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Locations/{locationId}/image/{imageId}": {
      "get": {
        "tags": [
          "Locations"
        ],
        "summary": "Gets the content of a specific image for a location.",
        "operationId": "GetLocationImage",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "imageId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "boolean",
            "name": "download",
            "in": "query",
            "default": false,
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Locations"
        ],
        "summary": "Deletes an image from a location.",
        "operationId": "DeleteLocationImage",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "imageId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Locations/{id}/image": {
      "post": {
        "tags": [
          "Locations"
        ],
        "summary": "Uploads an image for a location.",
        "operationId": "UploadLocationImage",
        "consumes": [
          "multipart/form-data"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "MediaId",
            "in": "formData",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "CustomerId",
            "in": "formData",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "formData",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "file",
            "name": "File",
            "in": "formData",
            "x-nullable": true
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        }
      }
    },
    "/Locations/{locationId}/image/{imageId}/setactive": {
      "patch": {
        "tags": [
          "Locations"
        ],
        "summary": "Sets an image as the active image for a location.",
        "operationId": "SetActiveLocationImage",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "imageId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Measurements/aggregated": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Gets aggregated measurements based on the specified query parameters.",
        "operationId": "GetAggregatedMeasurements",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "SensorId",
            "in": "query",
            "description": "Gets or sets the sensor ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "description": "Gets or sets the sub-location ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "description": "Gets or sets the sub-location ID.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "From",
            "in": "query",
            "description": "Gets or sets the start date for the query.",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Till",
            "in": "query",
            "description": "Gets or sets the end date for the query.",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Aggregate",
            "in": "query",
            "description": "Gets or sets the aggregation type.",
            "x-schema": {
              "$ref": "#/definitions/Aggregate"
            },
            "x-nullable": false,
            "enum": [
              "Avg",
              "Min",
              "Max"
            ]
          },
          {
            "type": "string",
            "name": "TimePeriod",
            "in": "query",
            "description": "Gets or sets the time period for the query.",
            "x-schema": {
              "$ref": "#/definitions/TimePeriod"
            },
            "x-nullable": false,
            "enum": [
              "C",
              "D",
              "W",
              "M",
              "Y"
            ]
          },
          {
            "type": "integer",
            "name": "Interval",
            "in": "query",
            "description": "Gets or sets the interval for the data.",
            "format": "int32",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Granularity",
            "in": "query",
            "description": "Gets or sets the granularity of the data.",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorClassId",
            "in": "query",
            "description": "Gets or sets the SensorClassId",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The aggregated measurements.",
            "schema": {
              "$ref": "#/definitions/GetMeasurementsAggregatedQueryResponse"
            }
          }
        }
      }
    },
    "/Measurements/binary-state-changes": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Gets binary measurement state changes (on/off) within a time window.",
        "operationId": "GetBinaryMeasurementStateChanges",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorClassIds",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "FromDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "TillDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/BinaryMeasurementStateChangeDto"
              }
            }
          }
        }
      }
    },
    "/Measurements/sensorclass-aggregated": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Gets aggregated measurements by sensorclass Ids.",
        "operationId": "GetAggregatedBySensorClass",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "DeviceId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorClassIds",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "Granularity",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "FromDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "TillDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The aggregated measurements.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SensorClassAggregateBucketDto"
              }
            }
          }
        }
      }
    },
    "/Measurements/absolute": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Gets absolute total values for a device sensor.",
        "operationId": "GetAbsoluteValuesForDeviceSensor",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "DeviceId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "DeviceSensorCode",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "From",
            "in": "query",
            "format": "date-time",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Till",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The absolute total values for the device sensor.",
            "schema": {
              "$ref": "#/definitions/GetAbsoluteValuesByDeviceSensorQueryResponse"
            }
          }
        }
      }
    },
    "/Measurements/totals": {
      "get": {
        "tags": [
          "Measurements"
        ],
        "summary": "Gets total values comparison by location.",
        "operationId": "GetTotalValuesComparison",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "StartDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "EndDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "SensorClassIds",
            "in": "query",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "The total values comparison by location.",
            "schema": {
              "$ref": "#/definitions/GetTotalValuesByLocationQueryResponse"
            }
          }
        }
      }
    },
    "/MessageConverter/DeviceType/{deviceTypeId}": {
      "get": {
        "tags": [
          "Message Converters"
        ],
        "summary": "Get Messagedecoder by devicetype UId.",
        "operationId": "GetMessageConverterByDeviceTypeId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "deviceTypeId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/GetMessageConverterResponse"
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Metering/energy-usage": {
      "get": {
        "tags": [
          "Metering"
        ],
        "operationId": "GetEnergyAndPowerUsageAndCost",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "DeviceId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "StartDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "EndDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/EnergyAndPowerUsageDto"
              }
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Metering/utility": {
      "get": {
        "tags": [
          "Metering"
        ],
        "operationId": "GetUtilityUsageAndCost",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "DeviceId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "StartDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "EndDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/UtilityUsageAndCostDto"
              }
            }
          },
          "404": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/NotificationReceivers": {
      "get": {
        "tags": [
          "Notification Receivers"
        ],
        "operationId": "GetReceivers",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "ThresholdId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "array",
            "name": "Channels",
            "in": "query",
            "collectionFormat": "multi",
            "x-nullable": true,
            "items": {
              "type": "string"
            }
          },
          {
            "type": "integer",
            "name": "SeverityLevel",
            "in": "query",
            "format": "int32",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "IncludePushSubcriptions",
            "in": "query",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/GetNotificationReceiversQueryResponse"
            }
          }
        }
      }
    },
    "/NotificationReceivers/Update": {
      "put": {
        "tags": [
          "Notification Receivers"
        ],
        "operationId": "UpdateReceiverChannel",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateUserNotifictionChannelCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/UpdateUserNotifictionChannelCommandResponse"
            }
          }
        }
      }
    },
    "/Prices": {
      "get": {
        "tags": [
          "Prices"
        ],
        "operationId": "GetPrices",
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "ValidAt",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "ShowExpired",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "ShowArchived",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "UtilityType",
            "in": "query",
            "x-schema": {
              "$ref": "#/definitions/UtilityType"
            },
            "x-nullable": true,
            "enum": [
              "None",
              "Electricity",
              "Gas",
              "Water"
            ]
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Prices"
        ],
        "operationId": "Prices_CreatePrice",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreatePriceCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Prices/{id}": {
      "get": {
        "tags": [
          "Prices"
        ],
        "operationId": "GetPriceById",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Prices"
        ],
        "operationId": "Prices_UpdatePrice",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdatePriceCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Prices"
        ],
        "operationId": "Prices_DeletePrice",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Prices/Currencies": {
      "get": {
        "tags": [
          "Prices"
        ],
        "operationId": "GetCurrencies",
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Push/register": {
      "post": {
        "tags": [
          "Push"
        ],
        "summary": "Register a push notification subscription.",
        "operationId": "RegisterPushSubscription",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "dto",
            "in": "body",
            "required": true,
            "description": "Subscription DTO",
            "schema": {
              "$ref": "#/definitions/SubscriptionDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Push/unregister": {
      "post": {
        "tags": [
          "Push"
        ],
        "summary": "Register a push notification subscription.",
        "operationId": "UnRegisterPushSubscription",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "dto",
            "in": "body",
            "required": true,
            "description": "Subscription DTO",
            "schema": {
              "$ref": "#/definitions/SubscriptionDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Push/send": {
      "post": {
        "tags": [
          "Push"
        ],
        "summary": "Send a push notification.",
        "operationId": "SendPushNotification",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "dto",
            "in": "body",
            "required": true,
            "description": "Push notification DTO",
            "schema": {
              "$ref": "#/definitions/PushNotificationDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/SensorClasses/customer/{customerId}": {
      "get": {
        "tags": [
          "Sensor Classes"
        ],
        "summary": "Get all sensor classes for a customer.",
        "operationId": "GetSensorClassesByCustomer",
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "description": "Customer id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "List of sensor classes",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/SensorClasses": {
      "get": {
        "tags": [
          "Sensor Classes"
        ],
        "summary": "Get all sensor classes.",
        "operationId": "GetAllSensorClasses",
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "List of sensor classes",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/Sensors": {
      "get": {
        "tags": [
          "Sensors"
        ],
        "summary": "Gets a collection of sensors filtered by the specified sensor class criteria.",
        "operationId": "GetSensorData",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SensorClassIds",
            "in": "query",
            "x-nullable": true
          },
          {
            "type": "array",
            "name": "SensorClasses",
            "in": "query",
            "collectionFormat": "multi",
            "x-nullable": true,
            "items": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "An HTTP 200 response containing the matching sensors.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SensorDto"
              }
            }
          }
        }
      }
    },
    "/Sensors/{id}": {
      "get": {
        "tags": [
          "Sensors"
        ],
        "summary": "Gets details for a single sensor by its unique identifier.",
        "operationId": "GetSensorById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the sensor.",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "An HTTP 200 response containing the sensor details if found.",
            "schema": {
              "$ref": "#/definitions/SensorDto"
            }
          }
        }
      }
    },
    "/Statuses": {
      "get": {
        "tags": [
          "Statuses"
        ],
        "summary": "Get all statuses.",
        "operationId": "GetStatuses",
        "parameters": [
          {
            "type": "string",
            "name": "discriminator",
            "in": "query",
            "description": "Status discriminator",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "List of statuses",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Statuses"
        ],
        "summary": "Create a new status.",
        "operationId": "CreateStatus",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "Create status command",
            "schema": {
              "$ref": "#/definitions/CreateStatusCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": "Created status"
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Statuses/{id}": {
      "get": {
        "tags": [
          "Statuses"
        ],
        "summary": "Get status by id.",
        "operationId": "GetStatusById",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Status id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "Status",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Statuses"
        ],
        "summary": "Update an existing status.",
        "operationId": "UpdateStatus",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Status id",
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "Update status command",
            "schema": {
              "$ref": "#/definitions/UpdateStatusCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Statuses"
        ],
        "summary": "Delete a status.",
        "operationId": "DeleteStatus",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Status id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/SubLocations": {
      "get": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "GetSubLocations",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "query",
            "format": "guid",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "post": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "CreateSublocation",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateSubLocationCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "Delete Sublocation",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "query",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/SubLocations/{sublocationId}": {
      "get": {
        "tags": [
          "SubLocations"
        ],
        "summary": "Get Sublocation by id",
        "operationId": "GetSubLocationById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "sublocationId",
            "in": "path",
            "required": true,
            "description": "Sublocation Id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/SubLocationDto"
            }
          }
        }
      }
    },
    "/SubLocations/{id}/Edit": {
      "get": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "SubLocations_GetSubLocationForEdit",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/SubLocations/{locationId}/Create": {
      "get": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "SubLocations_GetSubLocationForCreate",
        "parameters": [
          {
            "type": "string",
            "name": "locationId",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/SubLocations/{id}": {
      "put": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "UpdateSublocation",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/UpdateSubLocationCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/SubLocations/{id}/status": {
      "put": {
        "tags": [
          "SubLocations"
        ],
        "operationId": "UpdateSublocationStatus",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SetSubLocationStatusCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/SubLocations/{sublocationId}/Status": {
      "get": {
        "tags": [
          "SubLocations"
        ],
        "summary": "Get Sublocation status by id",
        "operationId": "GetSubLocationStatusById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "sublocationId",
            "in": "path",
            "required": true,
            "description": "Sublocation Id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/StatusDto"
            }
          }
        }
      }
    },
    "/SubLocationTypes": {
      "get": {
        "tags": [
          "SubLocation Types"
        ],
        "summary": "Get all sublocation types.",
        "operationId": "GetAllSubLocationTypes",
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "List of sublocation types",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "post": {
        "tags": [
          "SubLocation Types"
        ],
        "summary": "Create a new sublocation type.",
        "operationId": "CreateSubLocationType",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "Create command",
            "schema": {
              "$ref": "#/definitions/CreateSubLocationTypeCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": "Created sublocation type"
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/SubLocationTypes/{id}": {
      "get": {
        "tags": [
          "SubLocation Types"
        ],
        "summary": "Get sublocation type by id.",
        "operationId": "GetSubLocationTypeById",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Sublocation type id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "Sublocation type",
            "schema": {
              "type": "file"
            }
          }
        }
      },
      "put": {
        "tags": [
          "SubLocation Types"
        ],
        "summary": "Update an existing sublocation type.",
        "operationId": "UpdateSubLocationType",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Sublocation type id",
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "Update command",
            "schema": {
              "$ref": "#/definitions/UpdateSubLocationTypeCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "400": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "SubLocation Types"
        ],
        "summary": "Delete a sublocation type.",
        "operationId": "DeleteSubLocationType",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Sublocation type id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Telemetry": {
      "post": {
        "tags": [
          "Telemetry"
        ],
        "summary": "Stores a telemetry sample and triggers downstream processing.",
        "operationId": "Telemetry_PostTelemetry",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "telemetry",
            "in": "body",
            "required": true,
            "description": "The telemetry model captured from a device.",
            "schema": {
              "$ref": "#/definitions/SenmoTelemetry"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "202": {
            "description": "An AcceptedResult indicating that processing has started."
          }
        }
      }
    },
    "/TelemetryEvents/id/{id}": {
      "get": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Gets a telemetry event by its unique event id.",
        "operationId": "GetTelemetryEventById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Id",
            "in": "query",
            "description": "The unique database id of the telemetry event.",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "EventId",
            "in": "query",
            "description": "The event id (alternate key).",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "includeDeviceInfo",
            "in": "query",
            "description": "Whether to include device info in the response.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Telemetry event details.",
            "schema": {
              "$ref": "#/definitions/GetTelemetryEventByIdQueryResponse"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Deletes a telemetry event by its unique event id.",
        "operationId": "DeleteTelemetryEventById",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "An OkResult when the event has been removed.",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/TelemetryEvents": {
      "get": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Gets a paged list of telemetry events for the current customer.",
        "operationId": "GetTelemetryEventsByCustomer",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "description": "The customer GUID.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "description": "Optional location filter.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SubLocationId",
            "in": "query",
            "description": "Optional sub-location filter.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "DeviceId",
            "in": "query",
            "description": "Optional device filter.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "UserRef",
            "in": "query",
            "description": "User reference for filtering events.",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "NotSeenOnly",
            "in": "query",
            "description": "If true, only events not seen by the user are returned.",
            "x-nullable": true
          },
          {
            "type": "boolean",
            "name": "ActiveOnly",
            "in": "query",
            "description": "If true, only active events are returned.",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "SeverityLevels",
            "in": "query",
            "description": "Comma-separated severity levels to filter.",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "EventStates",
            "in": "query",
            "description": "Comma-separated event states to filter.",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "FromDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "TillDate",
            "in": "query",
            "format": "date-time",
            "x-nullable": true
          },
          {
            "type": "integer",
            "name": "PageIndex",
            "in": "query",
            "description": "Page index. First page starts at index 1.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "PageSize",
            "in": "query",
            "description": "Amount of items to return per page. Default is 100.",
            "format": "int32",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "Search",
            "in": "query",
            "description": "Search query parameter.",
            "maxLength": 50,
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Telemetry event details.",
            "schema": {
              "$ref": "#/definitions/GetTelemetryEventsQueryResponse"
            }
          }
        }
      },
      "post": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Persists a telemetry event supplied by upstream services.",
        "operationId": "TelemetryEvents_PostTelemetryEvent",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "telemetryEvent",
            "in": "body",
            "required": true,
            "description": "The telemetry event description to store.",
            "schema": {
              "$ref": "#/definitions/TelemetryEventDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "202": {
            "description": "An AcceptedResult after the event has been queued for processing."
          }
        }
      }
    },
    "/TelemetryEvents/seen": {
      "post": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Marks a telemetry event notification as seen.",
        "operationId": "SetTelemetryEventNotificationSeen",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "command",
            "in": "body",
            "required": true,
            "description": "The command containing event-notification details. SetEventNotificationSeenCommand",
            "schema": {
              "$ref": "#/definitions/SetEventNotificationSeenCommand"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "An OkResult when the notification was updated.",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/TelemetryEvents/{id}/dismiss": {
      "put": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Dismiss telemetry event.",
        "operationId": "MarkTelemetryEventNotificationDismissed",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "userRef",
            "in": "query",
            "description": "Optional userRef.",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "An OkResult when the notification was updated.",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/TelemetryEvents/{id}/resolve": {
      "put": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Resolve telemetry event.",
        "operationId": "MarkTelemetryEventNotificationResolved",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event id.",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "userRef",
            "in": "query",
            "description": "Optional userRef.",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "An OkResult when the notification was updated.",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    },
    "/TelemetryEvents/EventNotification": {
      "post": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Persists a event notification supplied by upstream services.",
        "operationId": "TelemetryEvents_PostEventNotification",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "parameters": [
          {
            "name": "notificationDto",
            "in": "body",
            "required": true,
            "description": "The event notification to store.",
            "schema": {
              "$ref": "#/definitions/EventNotificationDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "202": {
            "description": "An AcceptedResult after the notification has been queued for processing."
          }
        }
      }
    },
    "/TelemetryEvents/active/count": {
      "get": {
        "tags": [
          "Telemetry Events"
        ],
        "summary": "Gets aggregate counts for the customer's active telemetry events.",
        "operationId": "GetActiveTelemetryEventsCount",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "CustomerId",
            "in": "query",
            "description": "Customer UID for which to compute active event counts.",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "LocationId",
            "in": "query",
            "description": "Optional location UID to filter events.",
            "format": "guid",
            "x-nullable": true
          },
          {
            "type": "string",
            "name": "UserRef",
            "in": "query",
            "description": "Optional user reference (user UID or external identifier) used to\ncalculate the UnseenCount.  When not provided, the current user is used.",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "Aggregated counts of active events and unseen events.",
            "schema": {
              "$ref": "#/definitions/ActiveEventsCountResult"
            }
          }
        }
      }
    },
    "/Thresholds/customer/{customerId}": {
      "get": {
        "tags": [
          "Thresholds"
        ],
        "summary": "Get thresholds by customer.",
        "operationId": "GetThresholdsByCustomerId",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "customerId",
            "in": "path",
            "required": true,
            "description": "Customer UId",
            "format": "guid",
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "pageIndex",
            "in": "query",
            "description": "Paging page index.",
            "format": "int32",
            "default": 1,
            "x-nullable": false
          },
          {
            "type": "integer",
            "name": "pageSize",
            "in": "query",
            "description": "Paging page size.",
            "format": "int32",
            "default": 100,
            "x-nullable": false
          },
          {
            "type": "string",
            "name": "search",
            "in": "query",
            "description": "Search.",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/GetThresholdsByCustomerResponse"
            }
          }
        }
      }
    },
    "/Thresholds/{id}": {
      "get": {
        "tags": [
          "Thresholds"
        ],
        "summary": "Get threshold by id",
        "operationId": "GetThresholdById",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Threshold Id",
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ThresholdModelDto"
            }
          }
        }
      },
      "put": {
        "tags": [
          "Thresholds"
        ],
        "summary": "Update a threshold",
        "operationId": "UpdateThreshold",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          },
          {
            "name": "model",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ThresholdDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Thresholds"
        ],
        "summary": "Delete a threshold",
        "operationId": "DeleteThreshold",
        "parameters": [
          {
            "type": "string",
            "name": "id",
            "in": "path",
            "required": true,
            "format": "guid",
            "x-nullable": false
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        }
      }
    },
    "/Thresholds": {
      "post": {
        "tags": [
          "Thresholds"
        ],
        "summary": "Create a threshold",
        "operationId": "CreateThreshold",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json",
          "application/xml",
          "text/xml",
          "application/*+xml"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/ThresholdDto"
            },
            "x-nullable": false
          }
        ],
        "responses": {
          "201": {
            "description": ""
          },
          "default": {
            "x-nullable": false,
            "description": "",
            "schema": {
              "$ref": "#/definitions/ProblemDetails"
            }
          }
        }
      }
    },
    "/Weather": {
      "get": {
        "tags": [
          "Weather"
        ],
        "operationId": "GetCurrentForCity",
        "parameters": [
          {
            "type": "string",
            "name": "City",
            "in": "query",
            "x-nullable": true
          }
        ],
        "responses": {
          "200": {
            "x-nullable": true,
            "description": "",
            "schema": {
              "type": "file"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "ProblemDetails": {
      "type": "object",
      "additionalProperties": {},
      "properties": {
        "type": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "integer",
          "format": "int32"
        },
        "detail": {
          "type": "string"
        },
        "instance": {
          "type": "string"
        }
      }
    },
    "AuthenticationResponse": {
      "type": "object",
      "required": [
        "userId",
        "validTo",
        "customerId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "userName": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "validTo": {
          "type": "string",
          "format": "date-time"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "fullName": {
          "type": "string"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "AuthenticationRequest": {
      "type": "object",
      "description": "Represents the credentials supplied when authenticating with email and password.",
      "required": [
        "email",
        "password"
      ],
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address of the user.",
          "minLength": 1
        },
        "password": {
          "type": "string",
          "description": "Gets or sets the plaintext password entered by the user.",
          "minLength": 1
        }
      }
    },
    "ApiKeyAuthenticationRequest": {
      "type": "object",
      "description": "Represents the payload used when authenticating with an API key.",
      "required": [
        "apiKey"
      ],
      "properties": {
        "apiKey": {
          "type": "string",
          "description": "Gets or sets the API key assigned to the integration.",
          "minLength": 1
        }
      }
    },
    "EmailAddressRequest": {
      "type": "object",
      "description": "Encapsulates an email address provided by the caller.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the recipient email address."
        }
      }
    },
    "ConfirmEmailRequest": {
      "type": "object",
      "description": "Represents the payload required to confirm a user's email address.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address that should be confirmed."
        },
        "token": {
          "type": "string",
          "description": "Gets or sets the confirmation token that validates the email."
        }
      }
    },
    "ResendEmailConfirmationRequest": {
      "type": "object",
      "description": "Represents a request to resend an email confirmation message.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address that should receive the confirmation message."
        }
      }
    },
    "SendPhoneCodeRequest": {
      "type": "object",
      "description": "Represents the payload used to send a verification code to a phone number.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address of the user requesting the code."
        },
        "phoneNumber": {
          "type": "string",
          "description": "Gets or sets the phone number that should receive the verification code."
        }
      }
    },
    "VerifyPhoneRequest": {
      "type": "object",
      "description": "Represents the payload required to verify a phone number with a previously issued code.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address associated with the phone number."
        },
        "phoneNumber": {
          "type": "string",
          "description": "Gets or sets the phone number being verified."
        },
        "code": {
          "type": "string",
          "description": "Gets or sets the verification code sent to the phone."
        }
      }
    },
    "ChangePasswordRequest": {
      "type": "object",
      "description": "Represents the payload required to change a user's password.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address of the account to change."
        },
        "currentPassword": {
          "type": "string",
          "description": "Gets or sets the user's current password for verification."
        },
        "newPassword": {
          "type": "string",
          "description": "Gets or sets the new password the user wants to apply."
        }
      }
    },
    "ForgotPasswordRequest": {
      "type": "object",
      "description": "Represents the payload sent when a user initiates a password reset.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address that should receive password reset instructions."
        }
      }
    },
    "ResetPasswordRequest": {
      "type": "object",
      "description": "Represents the payload required to complete a password reset.",
      "properties": {
        "email": {
          "type": "string",
          "description": "Gets or sets the email address of the account being reset."
        },
        "token": {
          "type": "string",
          "description": "Gets or sets the reset token issued to the user."
        },
        "newPassword": {
          "type": "string",
          "description": "Gets or sets the new password the user selected."
        }
      }
    },
    "AppDataDto": {
      "type": "object",
      "required": [
        "id",
        "customerId",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "entityType": {
          "type": "string"
        },
        "entityId": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "data": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "UpsertAppDataCommand": {
      "type": "object",
      "required": [
        "customerId"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "entityType": {
          "type": "string"
        },
        "entityId": {
          "type": "string"
        },
        "key": {
          "type": "string"
        },
        "data": {
          "type": "string"
        }
      }
    },
    "CalendarCategoryDto": {
      "type": "object",
      "required": [
        "customerId",
        "isFavourite"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "isFavourite": {
          "type": "boolean"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "CalendarEventDto": {
      "type": "object",
      "description": "Event DTO returned to the API with recurrence and attendee details.",
      "required": [
        "eventId",
        "uId",
        "locationId",
        "startDateTime",
        "endDateTime",
        "isAllDay",
        "created",
        "isDeleted"
      ],
      "properties": {
        "eventId": {
          "type": "string",
          "description": "Internal event identifier (PK).",
          "format": "guid"
        },
        "uId": {
          "type": "string",
          "description": "External/ICAL UID for idempotent references.",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "description": "Location UID.",
          "format": "guid"
        },
        "locationName": {
          "type": "string",
          "description": "Human readable location name."
        },
        "subLocationId": {
          "type": "string",
          "description": "Optional sublocation UID.",
          "format": "guid"
        },
        "subLocationName": {
          "type": "string",
          "description": "Human readable sublocation name."
        },
        "type": {
          "type": "string",
          "description": "Event category/type."
        },
        "category": {
          "type": "string",
          "description": "Event category."
        },
        "status": {
          "type": "string",
          "description": "Event status."
        },
        "title": {
          "type": "string",
          "description": "Event title."
        },
        "description": {
          "type": "string",
          "description": "Event description/body."
        },
        "startDateTime": {
          "type": "string",
          "description": "Start timestamp (with offset).",
          "format": "date-time"
        },
        "endDateTime": {
          "type": "string",
          "description": "End timestamp (with offset).",
          "format": "date-time"
        },
        "timeZone": {
          "type": "string",
          "description": "Time zone IANA/Windows identifier."
        },
        "isAllDay": {
          "type": "boolean",
          "description": "True when the event spans the entire day."
        },
        "recurrenceRule": {
          "type": "string",
          "description": "RFC 5545 RRULE string."
        },
        "recurrenceUntil": {
          "type": "string",
          "description": "End of recurrence, if any.",
          "format": "date-time"
        },
        "created": {
          "type": "string",
          "description": "Created timestamp.",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "description": "Last updated timestamp.",
          "format": "date-time"
        },
        "isDeleted": {
          "type": "boolean",
          "description": "Soft delete flag."
        },
        "exceptions": {
          "type": "array",
          "description": "Instance-level overrides for recurring events.",
          "items": {
            "$ref": "#/definitions/CalendarEventExceptionDto"
          }
        },
        "attendees": {
          "type": "array",
          "description": "Event attendees/contacts.",
          "items": {
            "$ref": "#/definitions/CalendarEventAttendeeDto"
          }
        }
      }
    },
    "CalendarEventExceptionDto": {
      "type": "object",
      "description": "DTO representing a single overridden occurrence of a recurring event.",
      "required": [
        "exceptionId",
        "eventId",
        "originalStart",
        "isCancelled"
      ],
      "properties": {
        "exceptionId": {
          "type": "string",
          "description": "Exception identifier.",
          "format": "guid"
        },
        "eventId": {
          "type": "string",
          "description": "Parent event UID.",
          "format": "guid"
        },
        "originalStart": {
          "type": "string",
          "description": "Original start that is being overridden.",
          "format": "date-time"
        },
        "isCancelled": {
          "type": "boolean",
          "description": "True if the instance is cancelled."
        },
        "newStartDateTime": {
          "type": "string",
          "description": "New start time if rescheduled.",
          "format": "date-time"
        },
        "newEndDateTime": {
          "type": "string",
          "description": "New end time if rescheduled.",
          "format": "date-time"
        }
      }
    },
    "CalendarEventAttendeeDto": {
      "type": "object",
      "description": "DTO for an attendee/contact on a calendar event.",
      "required": [
        "isCompany"
      ],
      "properties": {
        "contactId": {
          "type": "string",
          "description": "Contact UID.",
          "format": "guid"
        },
        "role": {
          "type": "string",
          "description": "Role on the event (Organizer, Attendee, Notified)."
        },
        "isCompany": {
          "type": "boolean",
          "description": "Set true when the attendee represents a company contact."
        },
        "companyName": {
          "type": "string",
          "description": "Company name when IsCompany is true."
        },
        "firstName": {
          "type": "string",
          "description": "Contact first name (for person attendees)."
        },
        "lastName": {
          "type": "string",
          "description": "Contact last name (for person attendees)."
        },
        "email": {
          "type": "string",
          "description": "Primary email address."
        },
        "phone": {
          "type": "string",
          "description": "Primary phone number."
        },
        "mobile": {
          "type": "string",
          "description": "Mobile phone number."
        },
        "imageId": {
          "type": "string",
          "format": "guid"
        }
      }
    },
    "CreateCalendarItemCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/CalendarCommand"
        },
        {
          "type": "object",
          "description": "Creates a new calendar event."
        }
      ]
    },
    "CalendarCommand": {
      "type": "object",
      "description": "Shared command fields for create/update calendar events.",
      "x-abstract": true,
      "required": [
        "customerId",
        "locationId",
        "startDateTime",
        "endDateTime",
        "isAllDay"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "title": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "startDateTime": {
          "type": "string",
          "format": "date-time"
        },
        "endDateTime": {
          "type": "string",
          "format": "date-time"
        },
        "timeZone": {
          "type": "string"
        },
        "isAllDay": {
          "type": "boolean"
        },
        "recurrenceRule": {
          "type": "string"
        },
        "recurrenceUntil": {
          "type": "string",
          "format": "date-time"
        },
        "attendees": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CalendarEventAttendeeDto"
          }
        }
      }
    },
    "UpdateCalendarItemCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/CalendarCommand"
        },
        {
          "type": "object",
          "description": "Updates an existing calendar event.",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "guid"
            }
          }
        }
      ]
    },
    "CalendarStatusDto": {
      "type": "object",
      "required": [
        "customerId",
        "isFavourite"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "isFavourite": {
          "type": "boolean"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "CalendarTypeDto": {
      "type": "object",
      "required": [
        "customerId",
        "isFavourite"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        },
        "isFavourite": {
          "type": "boolean"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "ChartSeriesDto": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ChartDataDto"
          }
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "sums": {
          "$ref": "#/definitions/ChartSumsDto"
        }
      }
    },
    "ChartDataDto": {
      "type": "object",
      "properties": {
        "y": {
          "type": "number",
          "format": "decimal"
        },
        "x": {
          "type": "string"
        }
      }
    },
    "ChartSumsDto": {
      "type": "object",
      "required": [
        "min",
        "max",
        "avg",
        "diff"
      ],
      "properties": {
        "min": {
          "type": "number",
          "format": "decimal"
        },
        "max": {
          "type": "number",
          "format": "decimal"
        },
        "avg": {
          "type": "number",
          "format": "decimal"
        },
        "diff": {
          "type": "number",
          "format": "decimal"
        },
        "usage": {
          "type": "number",
          "format": "decimal"
        },
        "isTotal": {
          "type": "boolean"
        }
      }
    },
    "Aggregate": {
      "type": "string",
      "description": "Enum representing aggregate functions.",
      "x-enumNames": [
        "Avg",
        "Min",
        "Max"
      ],
      "enum": [
        "Avg",
        "Min",
        "Max"
      ]
    },
    "TimePeriod": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "C",
        "D",
        "W",
        "M",
        "Y"
      ],
      "enum": [
        "C",
        "D",
        "W",
        "M",
        "Y"
      ]
    },
    "ContactRoleDto": {
      "type": "object",
      "required": [
        "id",
        "customerId",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "CreateContactRoleCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/ContactRoleCommandBase"
        },
        {
          "type": "object",
          "description": "Command to create a contact role for a customer."
        }
      ]
    },
    "ContactRoleCommandBase": {
      "type": "object",
      "x-abstract": true,
      "required": [
        "customerId"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        }
      }
    },
    "UpdateContactRoleCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/ContactRoleCommandBase"
        },
        {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "guid"
            }
          }
        }
      ]
    },
    "PagedResponseOfContactDto": {
      "allOf": [
        {
          "$ref": "#/definitions/PagedResponse"
        },
        {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ContactDto"
              }
            }
          }
        }
      ]
    },
    "ContactDto": {
      "type": "object",
      "description": "CRM contact shape exposed through the API.",
      "required": [
        "id",
        "customerId",
        "isCompany",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Contact UID.",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "description": "Owning customer UID.",
          "format": "guid"
        },
        "userId": {
          "type": "string",
          "description": "Linked user UID, when applicable.",
          "format": "guid"
        },
        "isCompany": {
          "type": "boolean",
          "description": "True when representing a company."
        },
        "companyName": {
          "type": "string",
          "description": "Company name (for company contacts)."
        },
        "firstName": {
          "type": "string",
          "description": "First name (for person contacts)."
        },
        "middleName": {
          "type": "string",
          "description": "Middle name."
        },
        "lastName": {
          "type": "string",
          "description": "Last name."
        },
        "jobTitle": {
          "type": "string",
          "description": "Job title."
        },
        "department": {
          "type": "string",
          "description": "Department."
        },
        "email": {
          "type": "string",
          "description": "Primary email."
        },
        "secondaryEmail": {
          "type": "string",
          "description": "Secondary email."
        },
        "phone": {
          "type": "string",
          "description": "Primary phone."
        },
        "mobile": {
          "type": "string",
          "description": "Mobile phone."
        },
        "cultureCode": {
          "type": "string",
          "description": "Culture/locale code (e.g., en-US)."
        },
        "title": {
          "type": "string",
          "description": "Personal or professional title (e.g., Mr, Dr)."
        },
        "website": {
          "type": "string",
          "description": "Website URL."
        },
        "linkedInUrl": {
          "type": "string",
          "description": "LinkedIn profile URL."
        },
        "addressLine1": {
          "type": "string",
          "description": "Address line 1."
        },
        "addressLine2": {
          "type": "string",
          "description": "Address line 2."
        },
        "city": {
          "type": "string",
          "description": "City."
        },
        "state": {
          "type": "string",
          "description": "State or province."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal/ZIP code."
        },
        "country": {
          "type": "string",
          "description": "Country."
        },
        "categories": {
          "type": "array",
          "description": "Categories/tags (JSON array serialized).",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": "string",
          "description": "Free-form notes."
        },
        "created": {
          "type": "string",
          "description": "Created timestamp.",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "description": "Updated timestamp.",
          "format": "date-time"
        },
        "imageId": {
          "type": "string",
          "description": "Avatar ImageId",
          "format": "guid"
        },
        "cityOfBirth": {
          "type": "string",
          "description": "City Of Birth"
        },
        "dateOfBirth": {
          "type": "string",
          "description": "Date of Birth",
          "format": "date"
        },
        "documentNumber": {
          "type": "string",
          "description": "Passport of ID document number"
        }
      }
    },
    "PagedResponse": {
      "type": "object",
      "required": [
        "pageIndex",
        "totalPages",
        "totalItems",
        "pageSize"
      ],
      "properties": {
        "pageIndex": {
          "type": "integer",
          "format": "int32"
        },
        "totalPages": {
          "type": "integer",
          "format": "int32"
        },
        "totalItems": {
          "type": "integer",
          "format": "int32"
        },
        "pageSize": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "CreateContactCommand": {
      "type": "object",
      "description": "Creates a CRM contact for a customer.",
      "required": [
        "customerId",
        "isCompany",
        "dateOfBirth"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "isCompany": {
          "type": "boolean"
        },
        "companyName": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "middleName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "jobTitle": {
          "type": "string"
        },
        "department": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "secondaryEmail": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "mobile": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "cultureCode": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "website": {
          "type": "string"
        },
        "linkedInUrl": {
          "type": "string"
        },
        "addressLine1": {
          "type": "string"
        },
        "addressLine2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": "string"
        },
        "cityOfBirth": {
          "type": "string"
        },
        "dateOfBirth": {
          "type": "string",
          "format": "date"
        },
        "documentNumber": {
          "type": "string"
        }
      }
    },
    "MediaInfoDto": {
      "type": "object",
      "description": "Data transfer object representing media information.",
      "required": [
        "id",
        "contentLength",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Gets or sets the unique identifier of the media.",
          "format": "guid"
        },
        "imageUrl": {
          "type": "string",
          "description": "Gets or sets the image URL of the media."
        },
        "filename": {
          "type": "string",
          "description": "Gets or sets the filename of the media."
        },
        "contentType": {
          "type": "string",
          "description": "Gets or sets the content type (MIME type) of the media."
        },
        "contentLength": {
          "type": "integer",
          "description": "Gets or sets the content length of the media in bytes.",
          "format": "int32"
        },
        "fileExtension": {
          "type": "string",
          "description": "Gets or sets the file extension of the media."
        },
        "mediaGroup": {
          "type": "string",
          "description": "Gets or sets the media group name."
        },
        "created": {
          "type": "string",
          "description": "Gets or sets the creation date of the media.",
          "format": "date-time"
        }
      }
    },
    "UpdateContactCommand": {
      "type": "object",
      "description": "Updates an existing contact for a customer.",
      "required": [
        "id",
        "customerId",
        "isCompany",
        "dateOfBirth"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "isCompany": {
          "type": "boolean"
        },
        "companyName": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "middleName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "jobTitle": {
          "type": "string"
        },
        "department": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "secondaryEmail": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "mobile": {
          "type": "string"
        },
        "fax": {
          "type": "string"
        },
        "cultureCode": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "website": {
          "type": "string"
        },
        "linkedInUrl": {
          "type": "string"
        },
        "addressLine1": {
          "type": "string"
        },
        "addressLine2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "notes": {
          "type": "string"
        },
        "cityOfBirth": {
          "type": "string"
        },
        "dateOfBirth": {
          "type": "string",
          "format": "date"
        },
        "documentNumber": {
          "type": "string"
        }
      }
    },
    "GetCustomerQueryResponse": {
      "type": "object",
      "description": "GetCustomerQuery response object",
      "properties": {
        "customer": {
          "$ref": "#/definitions/CustomerDto"
        }
      }
    },
    "CustomerDto": {
      "type": "object",
      "required": [
        "id",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "format": "date-time"
        },
        "name": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "timeZone": {
          "type": "string"
        }
      }
    },
    "GetCustomersQueryResponse": {
      "type": "object",
      "description": "GetCustomersQuery response object",
      "properties": {
        "customers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CustomerDto"
          }
        }
      }
    },
    "CreateCustomerCommandResponse": {
      "type": "object",
      "properties": {
        "customer": {
          "$ref": "#/definitions/CustomerDto"
        }
      }
    },
    "CreateCustomerCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/BaseRequest"
        },
        {
          "type": "object",
          "required": [
            "name",
            "code",
            "allowJoinByEmailDomain"
          ],
          "properties": {
            "name": {
              "type": "string",
              "description": "Customer name. Must be a unique name on the SENMO platform.",
              "maxLength": 255,
              "minLength": 2
            },
            "code": {
              "type": "string",
              "description": "Customer code. Arbitrary code that may be used for external reference.",
              "maxLength": 10,
              "minLength": 2
            },
            "emailDomain": {
              "type": "string",
              "maxLength": 50
            },
            "allowJoinByEmailDomain": {
              "type": "boolean"
            },
            "timeZone": {
              "type": "string",
              "maxLength": 255
            }
          }
        }
      ]
    },
    "BaseRequest": {
      "type": "object",
      "x-abstract": true
    },
    "DeleteCustomerCommandResponse": {
      "type": "object",
      "description": "DeleteCustomerCommand response object",
      "required": [
        "deleted"
      ],
      "properties": {
        "deleted": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "DeviceInfoDto": {
      "type": "object",
      "required": [
        "id",
        "customerId",
        "locationId",
        "subLocationId",
        "deviceTypeId",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "hardwareSerial": {
          "type": "string"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "customerName": {
          "type": "string"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "locationName": {
          "type": "string"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationName": {
          "type": "string"
        },
        "subLocationTypeId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationTypeName": {
          "type": "string"
        },
        "deviceTypeId": {
          "type": "string",
          "format": "guid"
        },
        "deviceTypeName": {
          "type": "string"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "sensors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeviceInfoSensorDto"
          }
        }
      }
    },
    "DeviceInfoSensorDto": {
      "type": "object",
      "required": [
        "id",
        "visible"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "deviceSensorCode": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "lastValue": {
          "type": "number",
          "format": "decimal"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "measureUnit": {
          "type": "string"
        },
        "measureUnitSymbol": {
          "type": "string"
        },
        "visible": {
          "$ref": "#/definitions/SensorVisibility"
        }
      }
    },
    "SensorVisibility": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Hidden",
        "Visible",
        "AlertsOnly"
      ],
      "enum": [
        "Hidden",
        "Visible",
        "AlertsOnly"
      ]
    },
    "UpdateSensorInfoQuery": {
      "type": "object",
      "description": "UpdateSensorInfo query object",
      "required": [
        "sensorId",
        "visible",
        "order"
      ],
      "properties": {
        "sensorId": {
          "type": "string",
          "format": "guid"
        },
        "label": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "visible": {
          "$ref": "#/definitions/SensorVisibility"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "updateAll": {
          "type": "boolean",
          "description": "Save these values to all other sensors of same type"
        }
      }
    },
    "UpdateDeviceInfoCommand": {
      "type": "object",
      "description": "UpdateDeviceInfo command object",
      "required": [
        "deviceId",
        "_deviceId",
        "_locationId"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "_deviceId": {
          "type": "integer",
          "format": "int32"
        },
        "_locationId": {
          "type": "integer",
          "format": "int32"
        },
        "_subLocationId": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "GetDevicesQueryResponse": {
      "allOf": [
        {
          "$ref": "#/definitions/PagedResponse"
        },
        {
          "type": "object",
          "description": "GetDevicesQuery response object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/DeviceDto"
              }
            }
          }
        }
      ]
    },
    "DeviceDto": {
      "type": "object",
      "required": [
        "id",
        "networkType",
        "created",
        "sendInterval"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "hardwareSerial": {
          "type": "string"
        },
        "networkType": {
          "type": "integer",
          "format": "int32"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationName": {
          "type": "string"
        },
        "locationName": {
          "type": "string"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "activationDate": {
          "type": "string",
          "format": "date-time"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "sendInterval": {
          "type": "integer",
          "format": "int32"
        },
        "sensors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeviceSensorDto"
          }
        },
        "deviceType": {
          "$ref": "#/definitions/DeviceTypeInfoDto"
        },
        "commands": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CommandCapabilityDto"
          }
        }
      }
    },
    "DeviceSensorDto": {
      "type": "object",
      "required": [
        "id",
        "deviceId",
        "visible",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "deviceSensorCode": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "visible": {
          "$ref": "#/definitions/SensorVisibility"
        },
        "lastValue": {
          "type": "number",
          "format": "decimal"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "lastValueUpdate": {
          "type": "string",
          "format": "date-time"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "capability": {
          "$ref": "#/definitions/CapabilityDto"
        },
        "state": {
          "$ref": "#/definitions/SensorStateDto"
        },
        "unitSymbol": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        }
      }
    },
    "CapabilityDto": {
      "type": "object",
      "required": [
        "precision",
        "stateClass",
        "capabilityType",
        "hidden",
        "utilityMeter",
        "utilityType"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "iconName": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "sensorClass": {
          "type": "string"
        },
        "schema": {
          "type": "string"
        },
        "precision": {
          "type": "integer",
          "format": "int32"
        },
        "stateClass": {
          "$ref": "#/definitions/StateClass"
        },
        "unit": {
          "type": "string"
        },
        "capabilityType": {
          "$ref": "#/definitions/CapabilityType"
        },
        "displayUnit": {
          "type": "string"
        },
        "conditionalExpression": {
          "type": "string"
        },
        "convertExpression": {
          "type": "string"
        },
        "hidden": {
          "type": "boolean"
        },
        "utilityMeter": {
          "type": "boolean"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        }
      }
    },
    "StateClass": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Measurement",
        "Total",
        "ResettingTotal",
        "Payload"
      ],
      "enum": [
        "Measurement",
        "Total",
        "ResettingTotal",
        "Payload"
      ]
    },
    "CapabilityType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Telemetry",
        "Command",
        "Attribute",
        "Property"
      ],
      "enum": [
        "Telemetry",
        "Command",
        "Attribute",
        "Property"
      ]
    },
    "UtilityType": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "None",
        "Electricity",
        "Gas",
        "Water"
      ],
      "enum": [
        "None",
        "Electricity",
        "Gas",
        "Water"
      ]
    },
    "SensorStateDto": {
      "type": "object",
      "required": [
        "level",
        "limit"
      ],
      "properties": {
        "sensorClass": {
          "type": "string"
        },
        "lastValue": {
          "type": "number",
          "format": "decimal"
        },
        "icon": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "level": {
          "type": "integer",
          "format": "int32"
        },
        "label": {
          "type": "string"
        },
        "unit": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "limit": {
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "DeviceTypeInfoDto": {
      "type": "object",
      "description": "Data transfer object representing device type information.",
      "required": [
        "id",
        "networkTypeId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Gets or sets the unique identifier of the device type.",
          "format": "guid"
        },
        "name": {
          "type": "string",
          "description": "Gets or sets the name of the device type."
        },
        "networkTypeId": {
          "type": "integer",
          "description": "Gets or sets the network type identifier associated with the device type.",
          "format": "int32"
        },
        "model": {
          "type": "string",
          "description": "Gets or sets the model of the device type."
        },
        "manufacturer": {
          "type": "string",
          "description": "Gets or sets the manufacturer of the device type."
        },
        "imageId": {
          "type": "string",
          "description": "Gets or sets the image identifier associated with the device type, if any.",
          "format": "guid"
        }
      }
    },
    "CommandCapabilityDto": {
      "type": "object",
      "required": [
        "capabilityType",
        "hidden"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "iconName": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "sensorClass": {
          "type": "string"
        },
        "capabilityType": {
          "$ref": "#/definitions/CapabilityType"
        },
        "conditionalExpression": {
          "type": "string"
        },
        "hidden": {
          "type": "boolean"
        }
      }
    },
    "DeviceBatteryStateDto": {
      "type": "object",
      "description": "GetDeviceBatteryStatusesQuery response object",
      "required": [
        "id",
        "customerId",
        "locationId",
        "subLocationId",
        "deviceTypeId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "hardwareSerial": {
          "type": "string"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "locationName": {
          "type": "string"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationName": {
          "type": "string"
        },
        "deviceTypeId": {
          "type": "string",
          "format": "guid"
        },
        "deviceTypeName": {
          "type": "string"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "battery": {
          "$ref": "#/definitions/SensorStateDto"
        }
      }
    },
    "GetDeviceTypesQueryResponse": {
      "type": "object",
      "properties": {
        "deviceTypes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeviceTypeDto"
          }
        }
      }
    },
    "DeviceTypeDto": {
      "type": "object",
      "required": [
        "id",
        "networkTypeId",
        "customerId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "manufacturer": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "shortDescription": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "imageId": {
          "type": "string",
          "format": "guid"
        },
        "networkTypeId": {
          "type": "integer",
          "format": "int32"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "defaultConverter": {
          "$ref": "#/definitions/MessageConverterDto"
        },
        "capabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DeviceTypeCapabilityDto"
          }
        }
      }
    },
    "MessageConverterDto": {
      "type": "object",
      "required": [
        "id",
        "decoderType"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "decodeFunction": {
          "type": "string"
        },
        "formatFunction": {
          "type": "string"
        },
        "encodeFunction": {
          "type": "string"
        },
        "decoderType": {
          "$ref": "#/definitions/DecoderTypes"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "DecoderTypes": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "v1_Telemetry_Deprecated",
        "v2_TTN_Standard"
      ],
      "enum": [
        "v1_Telemetry_Deprecated",
        "v2_TTN_Standard"
      ]
    },
    "DeviceTypeCapabilityDto": {
      "type": "object",
      "required": [
        "id",
        "capabilityType",
        "isOpenCloseType"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "capabilityType": {
          "$ref": "#/definitions/CapabilityType"
        },
        "code": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "isBinary": {
          "type": "boolean"
        },
        "isOpenCloseType": {
          "type": "boolean"
        },
        "capability": {
          "$ref": "#/definitions/Capability"
        },
        "sensorClass": {
          "$ref": "#/definitions/SensorClassDto"
        }
      }
    },
    "Capability": {
      "type": "object",
      "required": [
        "stateClass",
        "capabilityType",
        "hidden",
        "utilityMeter",
        "utilityType",
        "defaultVisibility",
        "created"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "sensorClass": {
          "type": "string"
        },
        "schema": {
          "type": "string"
        },
        "command": {
          "$ref": "#/definitions/CommandProps"
        },
        "precision": {
          "type": "integer",
          "format": "int32"
        },
        "stateClass": {
          "$ref": "#/definitions/StateClass"
        },
        "unit": {
          "type": "string"
        },
        "iconName": {
          "type": "string"
        },
        "capabilityType": {
          "$ref": "#/definitions/CapabilityType"
        },
        "displayUnit": {
          "type": "string"
        },
        "convertExpression": {
          "type": "string"
        },
        "hidden": {
          "type": "boolean"
        },
        "utilityMeter": {
          "type": "boolean"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        },
        "conditionalExpression": {
          "type": "string"
        },
        "defaultVisibility": {
          "$ref": "#/definitions/SensorVisibility"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "CommandProps": {
      "type": "object",
      "required": [
        "confirmed"
      ],
      "properties": {
        "payload": {
          "type": "string"
        },
        "port": {
          "type": "integer",
          "format": "int32"
        },
        "confirmed": {
          "type": "boolean"
        }
      }
    },
    "SensorClassDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "allowedUnits": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "thresholds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MinimalThresholdDto"
          }
        },
        "chartOptions": {
          "$ref": "#/definitions/SensorClassChartConfig"
        },
        "icon": {
          "type": "string"
        }
      }
    },
    "MinimalThresholdDto": {
      "type": "object",
      "required": [
        "level",
        "limit"
      ],
      "properties": {
        "level": {
          "type": "integer",
          "format": "int32"
        },
        "type": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        },
        "limit": {
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "SensorClassChartConfig": {
      "type": "object",
      "required": [
        "chartStep",
        "step"
      ],
      "properties": {
        "defaultChartType": {
          "type": "string"
        },
        "supportedChartTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "chartStep": {
          "type": "number",
          "format": "decimal"
        },
        "step": {
          "type": "number",
          "format": "decimal"
        },
        "min": {
          "type": "number",
          "format": "decimal"
        },
        "max": {
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "MediaContentDto": {
      "type": "object",
      "description": "Data transfer object representing the content of a media item.",
      "required": [
        "id",
        "contentLength"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Gets or sets the unique identifier of the media content.",
          "format": "guid"
        },
        "filename": {
          "type": "string",
          "description": "Gets or sets the filename of the media content."
        },
        "contentType": {
          "type": "string",
          "description": "Gets or sets the content type (MIME type) of the media content."
        },
        "contentLength": {
          "type": "integer",
          "description": "Gets or sets the length of the media content in bytes.",
          "format": "int32"
        },
        "content": {
          "type": "string",
          "description": "Gets or sets the binary content of the media.",
          "format": "byte"
        },
        "base64Content": {
          "type": "string",
          "description": "Gets or sets the base64 content of the media.",
          "format": "byte"
        },
        "referenceId": {
          "type": "string",
          "description": "Optional reference id as string (e.g., external linkage)."
        }
      }
    },
    "PagedResponseOfLocationDto": {
      "allOf": [
        {
          "$ref": "#/definitions/PagedResponse"
        },
        {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/LocationDto"
              }
            }
          }
        }
      ]
    },
    "LocationDto": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "name2": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "statusName": {
          "type": "string"
        },
        "statusId": {
          "type": "string",
          "format": "guid"
        },
        "sensorClasses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "utilityTypes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UtilityType"
          }
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TelemetryEventDto"
          }
        },
        "imageId": {
          "type": "string",
          "format": "guid"
        },
        "subLocations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SubLocationDto"
          }
        }
      }
    },
    "TelemetryEventDto": {
      "type": "object",
      "required": [
        "active",
        "eventStart",
        "severityLevel",
        "hitCount",
        "lastUpdate",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "eventId": {
          "type": "string"
        },
        "startEventId": {
          "type": "string"
        },
        "ids": {
          "$ref": "#/definitions/IdsCollection"
        },
        "active": {
          "type": "boolean"
        },
        "eventStart": {
          "type": "string",
          "format": "date-time"
        },
        "eventEnd": {
          "type": "string",
          "format": "date-time"
        },
        "severityLevel": {
          "type": "integer",
          "format": "int32"
        },
        "severityCode": {
          "type": "string"
        },
        "eventCode": {
          "type": "string"
        },
        "eventValue": {
          "type": "string"
        },
        "lastEventValue": {
          "type": "string"
        },
        "eventState": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "suggestedAction": {
          "type": "string"
        },
        "impact": {
          "type": "string"
        },
        "condition": {
          "type": "string"
        },
        "conditionText": {
          "type": "string"
        },
        "hitCount": {
          "type": "integer",
          "format": "int32"
        },
        "lastUpdate": {
          "type": "string",
          "format": "date-time"
        },
        "dismissed": {
          "type": "string",
          "format": "date-time"
        },
        "dismissedBy": {
          "type": "string"
        },
        "dismissedByName": {
          "type": "string"
        },
        "resolved": {
          "type": "string",
          "format": "date-time"
        },
        "resolvedBy": {
          "type": "string"
        },
        "resolvedByName": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "sensorClassId": {
          "type": "string"
        },
        "locationName": {
          "type": "string"
        },
        "subLocationName": {
          "type": "string"
        },
        "subLocationTypeName": {
          "type": "string"
        },
        "deviceName": {
          "type": "string"
        },
        "deviceTypeName": {
          "type": "string"
        },
        "notifications": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EventNotificationDto"
          }
        }
      }
    },
    "IdsCollection": {
      "allOf": [
        {
          "type": "object",
          "additionalProperties": {}
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "guid"
            },
            "customerId": {
              "type": "string",
              "format": "guid"
            },
            "locationId": {
              "type": "string",
              "format": "guid"
            },
            "subLocationId": {
              "type": "string",
              "format": "guid"
            },
            "sensorId": {
              "type": "string",
              "format": "guid"
            },
            "deviceId": {
              "type": "string",
              "format": "guid"
            },
            "triggerId": {
              "type": "string",
              "format": "guid"
            },
            "sensorCode": {
              "type": "string"
            },
            "deviceTypeId": {
              "type": "string",
              "format": "guid"
            }
          }
        }
      ]
    },
    "EventNotificationDto": {
      "type": "object",
      "required": [
        "customerId",
        "statusTimestamp"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "userRef": {
          "type": "string"
        },
        "receiverName": {
          "type": "string"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "eventId": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "messageBody": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "brokerName": {
          "type": "string"
        },
        "brokerMessageReference": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "statusTimestamp": {
          "type": "string",
          "format": "date-time"
        },
        "seenByUser": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "SubLocationDto": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "description": {
          "type": "string"
        },
        "iconName": {
          "type": "string"
        },
        "typeName": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "statusName": {
          "type": "string"
        },
        "statusId": {
          "type": "string",
          "format": "guid"
        },
        "typeId": {
          "type": "string",
          "format": "guid"
        },
        "sensorClasses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "utilityTypes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UtilityType"
          }
        }
      }
    },
    "StatusDto": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "color": {
          "type": "string"
        }
      }
    },
    "SetLocationStatusCommand": {
      "type": "object",
      "description": "SetLocationStatus command object",
      "required": [
        "locationId"
      ],
      "properties": {
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "statusId": {
          "type": "string",
          "format": "guid"
        }
      }
    },
    "CreateLocationCommandResponse": {
      "type": "object",
      "description": "CreateLocationCommand response object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        }
      }
    },
    "CreateLocationCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/LocationEditCommand"
        },
        {
          "type": "object"
        }
      ]
    },
    "LocationEditCommand": {
      "type": "object",
      "description": "Location command object",
      "required": [
        "customerId",
        "name",
        "_customerId"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "defaultContactId": {
          "type": "string",
          "format": "guid"
        },
        "id": {
          "type": "string",
          "format": "guid"
        },
        "statusId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "name2": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "latitude": {
          "type": "number",
          "format": "decimal"
        },
        "longitude": {
          "type": "number",
          "format": "decimal"
        },
        "_customerId": {
          "type": "integer",
          "format": "int32"
        },
        "_defaultContactId": {
          "type": "integer",
          "format": "int32"
        },
        "_statusId": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "UpdateLocationCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/LocationEditCommand"
        },
        {
          "type": "object"
        }
      ]
    },
    "LocationContactDto": {
      "type": "object",
      "required": [
        "id",
        "locationId",
        "contactId",
        "contactRoleId",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "contactId": {
          "type": "string",
          "format": "guid"
        },
        "contactRoleId": {
          "type": "string",
          "format": "guid"
        },
        "contactRoleName": {
          "type": "string"
        },
        "metadata": {
          "type": "string"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "contact": {
          "$ref": "#/definitions/ContactDto"
        }
      }
    },
    "CreateLocationContactCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/LocationContactCommandBase"
        },
        {
          "type": "object",
          "required": [
            "contactId",
            "contactRoleId"
          ],
          "properties": {
            "contactId": {
              "type": "string",
              "format": "guid"
            },
            "contactRoleId": {
              "type": "string",
              "format": "guid"
            }
          }
        }
      ]
    },
    "LocationContactCommandBase": {
      "type": "object",
      "x-abstract": true,
      "required": [
        "customerId",
        "locationId"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "metadata": {
          "type": "string"
        }
      }
    },
    "UpdateLocationContactCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/LocationContactCommandBase"
        },
        {
          "type": "object",
          "required": [
            "id",
            "contactRoleId"
          ],
          "properties": {
            "id": {
              "type": "string",
              "format": "guid"
            },
            "contactRoleId": {
              "type": "string",
              "format": "guid"
            }
          }
        }
      ]
    },
    "GetMeasurementsAggregatedQueryResponse": {
      "type": "object",
      "description": "GetMeasurementsAggregatedQuery response object",
      "properties": {
        "data": {
          "type": "array",
          "description": "Gets or sets the aggregated data.",
          "items": {
            "$ref": "#/definitions/MeasurementAggregateDto"
          }
        }
      }
    },
    "MeasurementAggregateDto": {
      "type": "object",
      "required": [
        "count",
        "min",
        "max",
        "avg",
        "timeSlot"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "format": "int32"
        },
        "min": {
          "type": "number",
          "format": "decimal"
        },
        "max": {
          "type": "number",
          "format": "decimal"
        },
        "avg": {
          "type": "number",
          "format": "decimal"
        },
        "timeSlot": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "BinaryMeasurementStateChangeDto": {
      "type": "object",
      "required": [
        "sensorId",
        "deviceId",
        "locationId",
        "subLocationId",
        "stateValue",
        "stateStart",
        "stateEnd",
        "durationSeconds",
        "durationMinutes"
      ],
      "properties": {
        "sensorClassId": {
          "type": "string"
        },
        "sensorId": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "stateValue": {
          "type": "integer",
          "format": "int32"
        },
        "stateStart": {
          "type": "string",
          "format": "date-time"
        },
        "stateEnd": {
          "type": "string",
          "format": "date-time"
        },
        "durationSeconds": {
          "type": "integer",
          "format": "int32"
        },
        "durationMinutes": {
          "type": "number",
          "format": "decimal"
        },
        "durationFormatted": {
          "type": "string"
        }
      }
    },
    "SensorClassAggregateBucketDto": {
      "type": "object",
      "required": [
        "bucketTime",
        "deviceId",
        "locationId",
        "recordCount",
        "firstMeasured",
        "lastMeasured"
      ],
      "properties": {
        "bucketTime": {
          "type": "string",
          "format": "date-time"
        },
        "sensorClassId": {
          "type": "string"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "recordCount": {
          "type": "integer",
          "format": "int32"
        },
        "firstMeasured": {
          "type": "string",
          "format": "date-time"
        },
        "lastMeasured": {
          "type": "string",
          "format": "date-time"
        },
        "minValue": {
          "type": "number",
          "format": "decimal"
        },
        "maxValue": {
          "type": "number",
          "format": "decimal"
        },
        "avgValue": {
          "type": "number",
          "format": "decimal"
        },
        "sumValue": {
          "type": "number",
          "format": "decimal"
        },
        "diffValue": {
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "GetAbsoluteValuesByDeviceSensorQueryResponse": {
      "type": "object",
      "description": "GetAbsoluteValuesByDeviceSensorQuery response object",
      "properties": {
        "max": {
          "type": "number",
          "format": "decimal"
        },
        "min": {
          "type": "number",
          "format": "decimal"
        },
        "diff": {
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "GetTotalValuesByLocationQueryResponse": {
      "type": "object",
      "description": "GetTotalValuesByLocationQuery response object",
      "required": [
        "startDate",
        "endDate"
      ],
      "properties": {
        "startDate": {
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "type": "string",
          "format": "date-time"
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TotalValueComparisonResult"
          }
        }
      }
    },
    "TotalValueComparisonResult": {
      "type": "object",
      "required": [
        "sensorId",
        "deviceId",
        "locationId",
        "subLocationId",
        "currentStartValue",
        "currentEndValue",
        "previousStartValue",
        "previousEndValue",
        "currentPeriodUsage",
        "previousPeriodUsage"
      ],
      "properties": {
        "sensorId": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "sensorLabel": {
          "type": "string"
        },
        "deviceSensorCode": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        },
        "unit": {
          "type": "string"
        },
        "currentStartValue": {
          "type": "number",
          "format": "decimal"
        },
        "currentEndValue": {
          "type": "number",
          "format": "decimal"
        },
        "previousStartValue": {
          "type": "number",
          "format": "decimal"
        },
        "previousEndValue": {
          "type": "number",
          "format": "decimal"
        },
        "currentPeriodUsage": {
          "type": "number",
          "format": "decimal"
        },
        "previousPeriodUsage": {
          "type": "number",
          "format": "decimal"
        },
        "percentChange": {
          "type": "number",
          "format": "decimal"
        }
      }
    },
    "GetMessageConverterResponse": {
      "type": "object",
      "properties": {
        "messageConverter": {
          "$ref": "#/definitions/MessageConverterDto"
        }
      }
    },
    "EnergyAndPowerUsageDto": {
      "type": "object",
      "required": [
        "sensorId",
        "deviceId",
        "subLocationId",
        "locationId",
        "customerId",
        "meterStartValue",
        "meterStartTimestamp",
        "meterEndValue",
        "meterEndTimestamp",
        "energyTotal",
        "timestamp"
      ],
      "properties": {
        "sensorId": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "sensorLabel": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "deviceName": {
          "type": "string"
        },
        "deviceSerialNumber": {
          "type": "string"
        },
        "deviceModel": {
          "type": "string"
        },
        "meterStartValue": {
          "type": "number",
          "format": "decimal"
        },
        "meterStartTimestamp": {
          "type": "string",
          "format": "date-time"
        },
        "meterEndValue": {
          "type": "number",
          "format": "decimal"
        },
        "meterEndTimestamp": {
          "type": "string",
          "format": "date-time"
        },
        "energyTotal": {
          "type": "number",
          "format": "decimal"
        },
        "energyImport": {
          "type": "number",
          "format": "decimal"
        },
        "energyExport": {
          "type": "number",
          "format": "decimal"
        },
        "pricePerUnit": {
          "type": "number",
          "format": "decimal"
        },
        "currencyISOCode": {
          "type": "string"
        },
        "totalCost": {
          "type": "number",
          "format": "decimal"
        },
        "powerAvg": {
          "type": "integer",
          "format": "int32"
        },
        "powerPeak": {
          "type": "integer",
          "format": "int32"
        },
        "powerCurrent": {
          "type": "integer",
          "format": "int32"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "UtilityUsageAndCostDto": {
      "type": "object",
      "required": [
        "sensorId",
        "deviceId",
        "locationId",
        "subLocationId",
        "customerId",
        "utilityType",
        "periodStart",
        "periodEnd",
        "startValue",
        "endValue",
        "usage",
        "amount",
        "calculatedAt"
      ],
      "properties": {
        "sensorId": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "sensorLabel": {
          "type": "string"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        },
        "deviceName": {
          "type": "string"
        },
        "deviceSerialNumber": {
          "type": "string"
        },
        "deviceModel": {
          "type": "string"
        },
        "periodStart": {
          "type": "string",
          "format": "date-time"
        },
        "periodEnd": {
          "type": "string",
          "format": "date-time"
        },
        "startValue": {
          "type": "number",
          "format": "decimal"
        },
        "endValue": {
          "type": "number",
          "format": "decimal"
        },
        "usage": {
          "type": "number",
          "format": "decimal"
        },
        "pricePerUnit": {
          "type": "number",
          "format": "decimal"
        },
        "currencyISOCode": {
          "type": "string"
        },
        "tariffLabel": {
          "type": "string"
        },
        "amount": {
          "type": "number",
          "format": "decimal"
        },
        "calculatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "GetNotificationReceiversQueryResponse": {
      "type": "object",
      "properties": {
        "notificationReceivers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/NotificationReceiverDto"
          }
        }
      }
    },
    "NotificationReceiverDto": {
      "type": "object",
      "properties": {
        "sourceId": {
          "type": "string"
        },
        "sourceType": {
          "type": "string",
          "description": "User settings, Action  or "
        },
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "userRef": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "culture": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "severityCode": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "cacheKey": {
          "type": "string"
        }
      }
    },
    "UpdateUserNotifictionChannelCommandResponse": {
      "type": "object",
      "required": [
        "userId",
        "isSuccesful"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "channel": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "isSuccesful": {
          "type": "boolean"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "UpdateUserNotifictionChannelCommand": {
      "type": "object",
      "required": [
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "channel": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "action": {
          "type": "string"
        }
      }
    },
    "CreatePriceCommand": {
      "type": "object",
      "description": "CreatePrice command object",
      "properties": {
        "price": {
          "$ref": "#/definitions/PriceDto"
        }
      }
    },
    "PriceDto": {
      "type": "object",
      "required": [
        "id",
        "customerId",
        "validFrom",
        "validTill",
        "amount",
        "utilityType",
        "anyLocation"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "label": {
          "type": "string"
        },
        "validFrom": {
          "type": "string",
          "format": "date-time"
        },
        "validTill": {
          "type": "string",
          "format": "date-time"
        },
        "amount": {
          "type": "number",
          "format": "decimal"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        },
        "currencyISOCode": {
          "type": "string"
        },
        "anyLocation": {
          "type": "boolean"
        },
        "locationIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "guid"
          }
        }
      }
    },
    "UpdatePriceCommand": {
      "type": "object",
      "description": "UpdatePrice command object",
      "required": [
        "price"
      ],
      "properties": {
        "price": {
          "$ref": "#/definitions/PriceDto"
        }
      }
    },
    "SubscriptionDto": {
      "type": "object",
      "required": [
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "format": "guid"
        },
        "endpoint": {
          "type": "string"
        },
        "fcmToken": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "deviceInfo": {
          "type": "string"
        },
        "p256dh": {
          "type": "string"
        },
        "auth": {
          "type": "string"
        }
      }
    },
    "PushNotificationDto": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        },
        "data": {}
      }
    },
    "SensorDto": {
      "type": "object",
      "required": [
        "id",
        "order",
        "visible"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "deviceSensorCode": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "utilityType": {
          "$ref": "#/definitions/UtilityType"
        },
        "label": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "visible": {
          "$ref": "#/definitions/SensorVisibility"
        },
        "lastValue": {
          "type": "number",
          "format": "decimal"
        },
        "lastSeen": {
          "type": "string",
          "format": "date-time"
        },
        "lastValueUpdate": {
          "type": "string",
          "format": "date-time"
        },
        "capability": {
          "$ref": "#/definitions/CapabilityDto"
        },
        "state": {
          "$ref": "#/definitions/SensorStateDto"
        },
        "unit": {
          "type": "string"
        }
      }
    },
    "CreateStatusCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/StatusCommand"
        },
        {
          "type": "object"
        }
      ]
    },
    "StatusCommand": {
      "type": "object",
      "description": "StatusCommand command object",
      "x-abstract": true,
      "required": [
        "customerId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        }
      }
    },
    "UpdateStatusCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/StatusCommand"
        },
        {
          "type": "object",
          "description": "UpdateStatusCommand command object  "
        }
      ]
    },
    "CreateSubLocationCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/SubLocationCommand"
        },
        {
          "type": "object",
          "description": "CreateSubLocation command object"
        }
      ]
    },
    "SubLocationCommand": {
      "type": "object",
      "description": "SubLocation command object",
      "x-abstract": true,
      "required": [
        "customerId",
        "locationId"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        },
        "statusId": {
          "type": "string",
          "format": "guid"
        },
        "typeId": {
          "type": "string",
          "format": "guid"
        },
        "isDefault": {
          "type": "boolean"
        }
      }
    },
    "UpdateSubLocationCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/SubLocationCommand"
        },
        {
          "type": "object"
        }
      ]
    },
    "SetSubLocationStatusCommand": {
      "type": "object",
      "description": "SetSubLocationStatus command object",
      "required": [
        "subLocationId"
      ],
      "properties": {
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "statusId": {
          "type": "string",
          "format": "guid"
        }
      }
    },
    "CreateSubLocationTypeCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/SubLocationTypeCommand"
        },
        {
          "type": "object"
        }
      ]
    },
    "SubLocationTypeCommand": {
      "type": "object",
      "description": "CreateSubLocationType command object",
      "required": [
        "customerId",
        "_cusomterId"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "id": {
          "type": "string",
          "format": "guid"
        },
        "name": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "_cusomterId": {
          "type": "integer",
          "format": "int32"
        },
        "_id": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "UpdateSubLocationTypeCommand": {
      "allOf": [
        {
          "$ref": "#/definitions/SubLocationTypeCommand"
        },
        {
          "type": "object",
          "description": "UpdateSubLocationType command object"
        }
      ]
    },
    "SenmoTelemetry": {
      "type": "object",
      "required": [
        "timestamp"
      ],
      "properties": {
        "ids": {
          "$ref": "#/definitions/IdsCollection2"
        },
        "port": {
          "type": "integer",
          "format": "int32"
        },
        "payload": {
          "type": "string"
        },
        "decoded": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PayloadItem"
          }
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "metadata": {
          "$ref": "#/definitions/Metadata"
        }
      }
    },
    "IdsCollection2": {
      "allOf": [
        {
          "type": "object",
          "additionalProperties": {}
        },
        {
          "type": "object",
          "required": [
            "customerId"
          ],
          "properties": {
            "customerId": {
              "type": "string",
              "format": "guid"
            },
            "deviceId": {
              "type": "string"
            },
            "locationId": {
              "type": "string"
            },
            "sublocationId": {
              "type": "string"
            },
            "locationIdString": {
              "type": "string"
            },
            "sublocationIdString": {
              "type": "string"
            }
          }
        }
      ]
    },
    "PayloadItem": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string"
        },
        "value": {},
        "unit": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "Metadata": {
      "allOf": [
        {
          "type": "object",
          "additionalProperties": {}
        },
        {
          "type": "object",
          "properties": {
            "gateway": {
              "$ref": "#/definitions/GatewayInfo"
            },
            "reference": {
              "$ref": "#/definitions/ReferenceInfo"
            }
          }
        }
      ]
    },
    "GatewayInfo": {
      "type": "object",
      "properties": {
        "gateway_Id": {
          "type": "string"
        },
        "eui": {
          "type": "string"
        }
      }
    },
    "ReferenceInfo": {
      "type": "object",
      "properties": {
        "customerName": {
          "type": "string"
        },
        "locationName": {
          "type": "string"
        },
        "subLocationName": {
          "type": "string"
        },
        "subLocationTypeName": {
          "type": "string"
        },
        "deviceTypeName": {
          "type": "string"
        },
        "deviceName": {
          "type": "string"
        }
      }
    },
    "GetTelemetryEventByIdQueryResponse": {
      "type": "object",
      "description": "Response object for GetTelemetryEventByIdQuery.",
      "properties": {
        "event": {
          "description": "The telemetry event details.",
          "allOf": [
            {
              "$ref": "#/definitions/TelemetryEventDto"
            }
          ]
        },
        "deviceInfo": {
          "description": "Device info if requested.",
          "allOf": [
            {
              "$ref": "#/definitions/DeviceInfoDto"
            }
          ]
        }
      }
    },
    "GetTelemetryEventsQueryResponse": {
      "allOf": [
        {
          "$ref": "#/definitions/PagedResponseOfTelemetryEventDto"
        },
        {
          "type": "object",
          "description": "Response object for GetTelemetryEventsQuery."
        }
      ]
    },
    "PagedResponseOfTelemetryEventDto": {
      "allOf": [
        {
          "$ref": "#/definitions/PagedResponse"
        },
        {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/TelemetryEventDto"
              }
            }
          }
        }
      ]
    },
    "SetEventNotificationSeenCommand": {
      "type": "object",
      "description": "SetEventNotificationSeen command object",
      "required": [
        "customerId",
        "dismissEvent",
        "resolveEvent"
      ],
      "properties": {
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "userRef": {
          "type": "string",
          "description": "User ID or email"
        },
        "eventId": {
          "type": "string"
        },
        "notificationId": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "seenAt": {
          "type": "string",
          "format": "date-time"
        },
        "dismissEvent": {
          "type": "boolean"
        },
        "resolveEvent": {
          "type": "boolean"
        }
      }
    },
    "ActiveEventsCountResult": {
      "type": "object",
      "description": "Aggregated result for active telemetry events.",
      "required": [
        "total",
        "unseenCount"
      ],
      "properties": {
        "total": {
          "type": "integer",
          "description": "Total number of active events that match the query filter.",
          "format": "int32"
        },
        "unseenCount": {
          "type": "integer",
          "description": "Number of active events that have not yet been seen by the user (when UserRef is provided).",
          "format": "int32"
        },
        "locations": {
          "type": "object",
          "description": "Active event counts grouped by location UID.",
          "additionalProperties": {
            "type": "integer",
            "format": "int32"
          }
        },
        "subLocations": {
          "type": "object",
          "description": "Active event counts grouped by sublocation UID.",
          "additionalProperties": {
            "type": "integer",
            "format": "int32"
          }
        }
      }
    },
    "GetThresholdsByCustomerResponse": {
      "allOf": [
        {
          "$ref": "#/definitions/PagedResponse"
        },
        {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ThresholdModelDto"
              }
            }
          }
        }
      ]
    },
    "ThresholdModelDto": {
      "allOf": [
        {
          "$ref": "#/definitions/ThresholdDto"
        },
        {
          "type": "object",
          "properties": {
            "threshold": {
              "$ref": "#/definitions/ThresholdDto"
            },
            "subLocation": {
              "$ref": "#/definitions/SubLocationDto"
            },
            "location": {
              "$ref": "#/definitions/LocationDto"
            },
            "device": {
              "$ref": "#/definitions/DeviceInfoDto"
            },
            "created": {
              "type": "string",
              "format": "date-time"
            },
            "lastModified": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      ]
    },
    "ThresholdDto": {
      "type": "object",
      "required": [
        "severityLevel",
        "lowerLimit",
        "upperLimit"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "customerId": {
          "type": "string",
          "format": "guid"
        },
        "subLocationId": {
          "type": "string",
          "format": "guid"
        },
        "locationId": {
          "type": "string",
          "format": "guid"
        },
        "deviceId": {
          "type": "string",
          "format": "guid"
        },
        "telemetryTypeCode": {
          "type": "string"
        },
        "sensorClassId": {
          "type": "string"
        },
        "severityCode": {
          "type": "string"
        },
        "severityLevel": {
          "type": "integer",
          "format": "int32"
        },
        "comparisonOperator": {
          "type": "string"
        },
        "lowerLimit": {
          "type": "number",
          "format": "decimal"
        },
        "upperLimit": {
          "type": "number",
          "format": "decimal"
        },
        "description": {
          "type": "string"
        },
        "impact": {
          "type": "string"
        },
        "suggestedAction": {
          "type": "string"
        },
        "fromTime": {
          "type": "string"
        },
        "fromMinutes": {
          "type": "string"
        },
        "tillTime": {
          "type": "string"
        },
        "timeWindow": {
          "type": "string"
        },
        "aggregate": {
          "type": "string"
        },
        "snoozedTill": {
          "type": "string",
          "format": "date-time"
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/EventActionDto"
          }
        },
        "subLocationTypes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ReferenceItem"
          }
        },
        "subLocationStates": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ReferenceItem"
          }
        },
        "locationStates": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ReferenceItem"
          }
        },
        "daysOfWeek": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DayOfWeek"
          }
        },
        "timeOfDay": {
          "$ref": "#/definitions/TimeOfDayWindow"
        }
      }
    },
    "EventActionDto": {
      "type": "object",
      "required": [
        "disabled",
        "created"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "guid"
        },
        "thresholdId": {
          "type": "string",
          "format": "guid"
        },
        "eventType": {
          "type": "string"
        },
        "actionType": {
          "type": "string"
        },
        "data": {
          "$ref": "#/definitions/EventActionData"
        },
        "disabled": {
          "type": "boolean"
        },
        "delete": {
          "type": "boolean"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "updated": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "EventActionData": {
      "type": "object",
      "properties": {
        "recipients": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Recipient"
          }
        },
        "userTags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "contactRoles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "message": {
          "type": "string"
        }
      }
    },
    "Recipient": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "ReferenceItem": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "icon": {
          "type": "string"
        }
      }
    },
    "DayOfWeek": {
      "type": "string",
      "description": "",
      "x-enumNames": [
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday"
      ],
      "enum": [
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday"
      ]
    },
    "TimeOfDayWindow": {
      "type": "object",
      "required": [
        "notBetween",
        "start",
        "end"
      ],
      "properties": {
        "notBetween": {
          "type": "boolean"
        },
        "start": {
          "type": "string",
          "format": "time"
        },
        "end": {
          "type": "string",
          "format": "time"
        }
      }
    }
  }
}