openapi: 3.0.0
info:
  title: Management for Electronic Temperature Sensors
  description: Use the green **Authorize** button to enter your apikey.
  contact: {}
  version: "1.13.2"

servers:
  - url: 'https://api.zebra.com/v2'
    description: Production server
    variables: {}
security:
  - bearerAuth: []
  - ApiKeyAuth: []

paths:
  /environmental/tasks:
    post:
      summary: Creates a new Task
      tags:
        - Task Management
      description: Creates a Task based on the settings of the sensor type, sampling interval, alarm thresholds, durations and other fields in the request body.
      operationId: Create a Task
      requestBody:
        description: Request object in JSON format with settings for creating a new Task. <br><br>Edit the field values in the *Example Value* below. Click on the word *Schema* to see descriptions for each field. Click '>' to expand the Schema field descriptions, field types and valid ranges.
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CreateTaskFromDetailsStartImmediatelyRequest'
                - $ref: '#/components/schemas/CreateTaskFromDetailsDelayedMinutesRequest'
                - $ref: '#/components/schemas/CreateTaskFromDetailsDelayedUntilRequest'
        required: true
      responses:
        '200':
          description: A successful response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTaskResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
      deprecated: false
    get:
      summary: Retrieves Tasks
      tags:
        - Task Management
      description: Retrieves Tasks
      operationId: Retrieve a list of Tasks
      parameters:
        - name: page
          description: Page number, starting from 0.
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: size
          description: Number of elements per page. Greater than 0.
          in: query
          required: true
          schema:
            type: integer
            format: int64
        - name: text_filter
          description: Used for searching for specific Tasks by name.
          in: query
          required: false
          schema:
            type: string
        - name: updated_from
          description: "Required when the updated_to is set. Used in conjunction with the updated_to to filter the tasks by the last updated date, in the format of YYYY-MM-DDTHH:mm:ss.SSSSSSZ, e.g., 2022-10-28T05:41:43.620792Z. The updated_from cannot be later than the updated_to."
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: updated_to
          description: "Required when the updated_from is set. Used in conjunction with the updated_from to filter the tasks by the last updated date, in the format of YYYY-MM-DDTHH:mm:ss.SSSSSSZ, e.g., 2022-11-28T05:41:43.620792Z. The updated_to cannot be earlier than the updated_from."
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: statuses
          description: Optional. Used to filter Tasks with specifics status(es). An empty list implies no filtering (none) is desired.
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - TASK_STATUS_ACTIVE
                - TASK_STATUS_ACTIVE_WITH_ALARM
                - TASK_STATUS_SENSOR_REQUIRED
                - TASK_STATUS_SENSOR_COMPLETED
                - TASK_STATUS_START_PENDING
                - TASK_STATUS_STOP_PENDING
        - name: sensor_mac_address
          description: "Optional. Used to filter Tasks with specific associated sensors. An empty value implies no filtering is desired. <br> Example: 00074DDDA28C"
          in: query
          required: false
          schema:
            type: string
        - name: sort_field
          description: Used to sort tasks by field. Default Sort Field enum is SORT_FIELD_NAME.
          in: query
          required: false
          schema:
            type: string
            enum:
              - SORT_FIELD_NAME
              - SORT_FIELD_STATUS
              - SORT_FIELD_SENSOR_COUNT
              - SORT_FIELD_ALARM_COUNT
              - SORT_FIELD_CREATED
              - SORT_FIELD_UPDATED
              - SORT_FIELD_STARTED
              - SORT_FIELD_ENDED
            default: SORT_FIELD_NAME
        - name: sort_order
          description: Used to sort tasks by the specified order direction. ASC is the default order.
          in: query
          required: false
          schema:
            type: string
            enum:
              - SORT_ORDER_ASC
              - SORT_ORDER_DESC
            default: SORT_ORDER_ASC
      responses:
        '200':
          description: A successful response.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTaskResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
      deprecated: false
  /environmental/tasks/{taskId}:
    get:
      tags:
        - Task Management
      summary: Retrieves data for a Task
      operationId: Retrieve a Task
      description: Retrieves data for a specific Task.
      parameters:
        - name: taskId
          in: path
          description: 'Required. ID of the Task. <br>Example:  ''04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a''.'
          required: true
          schema:
            type: string
      responses:
        200:
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTaskResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
        '404':
          description: Resource not found.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              example:
                code: 5
                message: "Task with id '{taskId}' not found."
      deprecated: false
  /environmental/tasks/{taskId}/stop:
    post:
      summary: Stops a Task
      tags:
        - Task Management
      description: Stops the task specified by the taskId provided
      operationId: Stop a task
      parameters:
        - name: taskId
          in: path
          description: 'Required. ID of the Electronic Temperature Sensor Task you wish to stop. <br>Example:  ''04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a''.'
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: A successful response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StopTaskResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
              examples:
                1:
                  value:
                    message: "Task with id 'taskId' cannot be stopped."
      deprecated: false
  /environmental/tasks/{taskId}/alarms:
    get:
      tags:
        - Task Management
      summary: Retrieves alarms for a Task
      description: Retrieves alarms and associated data for a single Task
      operationId: TaskService_ListAlarms
      parameters:
        - name: taskId
          in: path
          description: 'Required. ID of the Task. <br>Example:  ''04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a''.'
          required: true
          schema:
            type: string
        - name: page.page
          in: query
          description: Optional. Page number, starting from 0.
          schema:
            type: integer
            format: int64
        - name: page.size
          in: query
          description: Required. Number of elements per page. Greater than 0.
          required: true
          schema:
            type: integer
            format: int64
        - name: sort_order
          in: query
          description: Optional. Used to specify the order direction (ascending or descending). The response is sorted by the date and time the alarm occurred.
          schema:
            type: string
            default: SORT_ORDER_ASC
            enum:
              - SORT_ORDER_ASC
              - SORT_ORDER_DESC
        - name: id
          in: query
          description: 'Optional. ID of the Sensor. Example: 952482b0-1291-4d22-90eb-f4ae9b462d08'
          schema:
            type: string
        - name: mac_address
          in: query
          description: 'Optional. MAC address of the Sensor. Example: 00074DDDA760'
          schema:
            type: string
        - name: serial_number
          in: query
          description: 'Optional. Serial number of the Sensor. Example: DLJ222801069'
          schema:
            type: string
      responses:
        200:
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAlarmsResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
  /environmental/tasks/{taskId}/assets:
    post:
      summary: Adds an asset to a Task
      tags:
        - Task Management
      description: Adds an asset to an Electronic Temperature Sensor task based on the taskId provided in the path and the asset provided in the request body.
      operationId: Add an asset to a task
      parameters:
        - name: taskId
          in: path
          description: ID of the task to which you want to add an asset
          required: true
          schema:
            type: string
      requestBody:
        description: Request object used for creating an asset in a Task.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddAssetRequest'
        required: true
      responses:
        '200':
          description: A successful response.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddAssetResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
              examples:
                1:
                  value:
                    message: "Asset 'assetId' is already associated with an active task."
                2:
                  value:
                    message: "Task with id 'taskId' is not active."
                3:
                  value:
                    message: "Asset limit of 100 reached on Task with id 'taskId'."
      deprecated: false

  /environmental/tasks/{taskId}/sensors:
    post:
      summary: Associates sensors with a Task
      tags:
        - Task Management
      description: "Associates sensor(s) to the task specified with a taskId"
      operationId: Associate task and sensors
      parameters:
        - name: taskId
          in: path
          description: The ID (uuid) of the task to which you want to associate sensor(s)
          required: true
          schema:
            type: string
            format: uuid
          example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
      requestBody:
        description: Request object used to associate sensors with a task
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssociateSensorRequest'
        required: true
      responses:
        '200':
          description: A successful response. One or more sensors were successfully associated with the task.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssociateSensorResponse'
        '400':
          description: An error response
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              example:
                code: 3
                message: "Task with id '{taskId}' has been stopped and can't have sensors associated."
        '401':
          description: Authentication information is missing or invalid.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              example:
                code: 7
                message: "Request lacking 'Key{name='x-zebra-zsbp-customer-auth-id'}' has been denied"
        '404':
          description: Resource not found.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              example:
                code: 5
                message: "Task with id '{taskId}' not found."

  /devices/environmental-sensors:
    get:
      summary: Retrieves sensors associated with a tenant
      tags:
        - Environmental Devices
      description: Retrieves sensors previously associated with a tenant
      operationId: Retrieve sensors
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
          required: false
          description: Page number, starting from 0

        - name: size
          in: query
          schema:
            type: integer
            minimum: 1
          required: true
          description: Page size, must be greater than 0

        - name: text_filter
          in: query
          schema:
            type: string
          required: false
          description: Used to filter sensors by name, MAC address or serial number.

        - name: task_id
          in: query
          schema:
            type: string
            format: uuid
          required: false
          description: 'ID of the Task. <br>Example:  ''04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a''.'

        - name: sort_field
          in: query
          schema:
            type: string
            enum:
              - SORT_FIELD_NAME
              - SORT_FIELD_STATUS
              - SORT_FIELD_SERIAL_NUMBER
              - SORT_FIELD_BATTERY_LEVEL
              - SORT_FIELD_UPDATED
              - SORT_FIELD_FIRST_SEEN
              - SORT_FIELD_SENSOR_ACTIVE
              - SORT_FIELD_ALARM_COUNT
              - SORT_FIELD_SENSOR_TASK_STATUS
            default: SORT_FIELD_NAME
          required: false
          description: Used to sort sensors by field

        - name: sort_order
          in: query
          schema:
            type: string
            enum:
              - SORT_ORDER_ASC
              - SORT_ORDER_DESC
            default: SORT_ORDER_ASC
          required: false
          description: Used to sort sensors by the specified order direction

        - name: statuses
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - SENSOR_STATUS_ACTIVE
                - SENSOR_STATUS_ACTIVE_WITH_ALARM
                - SENSOR_STATUS_STOPPED
          required: false
          description: Used to filter sensors by the provided list of statuses

        - name: exclude_low_battery
          in: query
          schema:
            type: boolean
            default: false
          required: false
          description: Used to filter out sensors with low battery. Battery levels <= 5% are considered low battery.

        - name: sensor_task_statuses
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - SENSOR_TASK_STATUS_START_PENDING
                - SENSOR_TASK_STATUS_ACTIVE
                - SENSOR_TASK_STATUS_ACTIVE_WITH_ALARM
                - SENSOR_TASK_STATUS_COMPLETED
                - SENSOR_TASK_STATUS_STOP_PENDING
                - SENSOR_TASK_STATUS_STOP_PENDING_COLD
          required: false
          description: Used to filter sensors by the provided list of sensor task statuses, when task_id is provided

        - name: enrolled_after
          in: query
          schema:
            type: string
            format: date-time
          required: false
          description: 'Used to filter sensors that were enrolled after the specified time frame (YYYY-MM-DDTHH:mm:ss.SSSSSSZ). <br>Example: ''2022-10-28T05:41:43.620792Z''.'

        - name: enrolled_before
          in: query
          schema:
            type: string
            format: date-time
          required: false
          description: 'Used to filter sensors that were enrolled before the specified time frame (YYYY-MM-DDTHH:mm:ss.SSSSSSZ). <br>Example: ''2022-10-28T05:41:43.620792Z''.'

      responses:
        '200':
          description: A successful response
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSensorsResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '400':
          description: An unexpected error response
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      deprecated: false

  /devices/environmental-sensors/{sensorId}/readings:
    post:
      summary: Request to upload the sensor temperature data
      tags:
        - Environmental Devices
      description: |
        Request to upload the most recent sensor temperature data since the last upload. This endpoint is only a request to upload the data. The user needs to call the Data Reporting API to fetch the data.
      operationId: RequestSensorReadings
      parameters:
        - name: sensorId
          in: path
          required: true
          description: The ID of the sensor from which the data upload is requested.
          schema:
            type: string
      responses:
        '200':
          description: Request accepted, in the next sensor seen event the command to upload the data will be sent to the sensor.
        '401':
          description: Authentication information is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '403':
          description: Permission denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 7
                    message: "Tenant xxxx not in allow list. User does not have permission to access this resource."
        '404':
          description: No active task found for sensor {sensorId}.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 5
                    message: "No active sensor task found for sensor id: 36d53742-f6c7-447f-ba2a-cd3fd75b34ed"
        '409':
          description: Read request already pending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 6
                    message: "Read request already pending"

  /devices/sensor-enrollments:
    post:
      summary: Requests enrollment for a sensor
      tags:
        - Devices Enrollment
      description: Requests sensor enrollment by the sensor serial number provided
      operationId: Request sensor enrollment
      requestBody:
        description: Request object used to request a sensor enrollment
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SensorEnrollmentRequest'
        required: true
      responses:
        '200':
          description: A successful response.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SensorEnrollmentResponse'
        '401':
          description: Authentication information is missing or invalid.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '409':
          description: Unable to request a sensor enrollment
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 6
                    message: "sensor already enrolled"
                2:
                  value:
                    code: 6
                    message: "sensor enrollment already started"
                3:
                  value:
                    code: 6
                    message: "sensor already has pending enrollment."
        '400':
          description: An unexpected error response
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      deprecated: false

  /devices/sensor-enrollments/{serialNumber}:
    delete:
      summary: Requests unenrollment for a sensor
      tags:
        - Devices Enrollment
      description: Requests sensor unenrollment by the sensor serial number provided. Currently, unenrollments are only supported by the ZB200 Bridge. In the future, the ZSFinder Android service will also support them.
      operationId: Request sensor unenrollment
      parameters:
        - name: serialNumber
          in: path
          description: The Serial Number of the sensor which you want to unenroll
          required: true
          schema:
            type: string
          example: 'ABC123456789'
      responses:
        '200':
          description: A successful response.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SensorUnenrollmentResponse'
        '400':
          description: Unable to unenroll a sensor due to a failed pre condition.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 3
                    message: "Brownout Sensor can't be unenrolled"
                2:
                  value:
                    code: 3
                    message: "Cannot start unenrollment when sensor is active"
        '401':
          description: Authentication information is missing or invalid.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: Suitable sensor to unenroll not found.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 5
                    message: "Unable to unenroll sensor. Sensor with serial number {serialNumber} is not registered in tenant"
        '409':
          description: Unenrollment request already exists or started.
          headers: { }
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
              examples:
                1:
                  value:
                    code: 6
                    message: "sensor unenrollment already started"
                2:
                  value:
                    code: 6
                    message: "sensor already has pending unenrollment"
      deprecated: false

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Access token
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
  schemas:
    error_message:
      type: object
      example:
        Code: string
        Message: string
        Info: string
    Any:
      type: object
      properties:
        '@type':
          type: string
    Status:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/Any'
      example:
        code: 3
        message: "Cannot create task with duplicate name for tenant"
    TaskStatus:
      type: string
      enum:
        - TASK_STATUS_ACTIVE
        - TASK_STATUS_ACTIVE_WITH_ALARM
        - TASK_STATUS_SENSOR_REQUIRED
        - TASK_STATUS_SENSOR_COMPLETED
        - TASK_STATUS_START_PENDING
        - TASK_STATUS_STOP_PENDING
      default: TASK_STATUS_ACTIVE
      description: |-
        Enum for task statuses.
    SensorTaskStatusOverview:
      type: object
      properties:
        active:
          type: integer
          format: uint64
          description: Number of sensor tasks with active status
        active_with_alarm:
          type: integer
          format: uint64
          description: Number of sensor tasks with active with alarm status
        completed:
          type: integer
          format: uint64
          description: Number of sensor tasks with completed status
        start_pending:
          type: integer
          format: uint64
          description: Number of sensor tasks with start pending status
        stop_pending:
          type: integer
          format: uint64
          description: Number of sensor tasks with stop pending status
      description: |-
        Object containing number of sensor tasks with a particular status. Used for
        pie chart.
    StopTaskResponse:
      type: object
      properties:
        task:
          $ref: '#/components/schemas/TaskResponse'
      title: Response object containing the stopped Task
    CreateTaskFromDetailsStartImmediatelyRequest:
      type: object
      description: Request object used for creating a Task with 'start_immediately' option enabled.
      properties:
        task_from_details:
          $ref: '#/components/schemas/TaskFromDetailsStartImmediateRequest'
    CreateTaskFromDetailsDelayedMinutesRequest:
      type: object
      description: Request object used for creating a Task with 'start_delayed' option enabled and 'delayed_minutes' configured.
      properties:
        task_from_details:
          $ref: '#/components/schemas/TaskFromDetailsDelayedMinutesRequest'
    CreateTaskFromDetailsDelayedUntilRequest:
      type: object
      description: Request object used for creating a Task with 'start_delayed' option enabled and  'delayed_until' configured.
      properties:
        task_from_details:
          $ref: '#/components/schemas/TaskFromDetailsDelayedUntilRequest'
    TaskFromDetailsStartImmediateRequest:
      type: object
      description: "Object containing information about the Task to be created"
      properties:
        task_details:
          $ref: '#/components/schemas/TaskDetailsStartImmediateRequest'
    TaskFromDetailsDelayedMinutesRequest:
      type: object
      description: "Object containing information about the Task to be created"
      properties:
        task_details:
          $ref: '#/components/schemas/TaskDetailsDelayedMinutesRequest'
    TaskFromDetailsDelayedUntilRequest:
      type: object
      description: "Object containing information about the Task to be created"
      properties:
        task_details:
          $ref: '#/components/schemas/TaskDetailsDelayedUntilRequest'
    TaskDetailsStartImmediateRequest:
      type: object
      description: Object containing additional information about a task
      properties:
        name:
          type: string
          description: Required. Unique human readable name to identify the task
          minLength: 3
          maxLength: 64
          example: mytask
        interval_minutes:
          type: integer
          format: int64
          description: Sensor sampling interval in minutes. Required if 'interval_seconds' not included or less than 15. Must be 1 or greater if the interval seconds is blank or less than 15
          minimum: 0
          maximum: 240
          example: 0
        interval_seconds:
          type: integer
          format: int64
          description: Sensor reading interval in seconds. Required if 'interval_minutes' not included. Must be greater than 0 if 'interval_minutes' included and equal or greater than 15 if not
          minimum: 0
          maximum: 59
          example: 15
        loop_reads:
          type: boolean
          description: Flag indicating whether to overwrite oldest data after 16,000 readings or not
          default: false
        start_immediately:
          $ref: '#/components/schemas/StartImmediateOptions'
        sensor_type:
          $ref: '#/components/schemas/SensorType'
        alarm_low_temp:
          type: number
          format: float
          example: 5.5
          description: Optional. Low sensor value threshold used to determine alarm conditions in celcius. Cannot be greater than 'alarm_high_temp'
          minimum: -40
          maximum: 84
        alarm_high_temp:
          type: number
          format: float
          example: 10.5
          description: Optional. High sensor value threshold used to determine alarm conditions in celcius. Cannot be lower than 'alarm_low_temp'
          minimum: -39
          maximum: 85
        notes:
          type: string
          example: "Human readable note as free text"
          description: Optional. Additional notes text for the task. String literal characters are accepted.
          maxLength: 1024
        low_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_seconds'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 60
          example: 10
        low_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_minutes'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 59
          example: 30
        high_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_seconds'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 60
          example: 10
        high_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_minutes'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 59
          example: 30
        required_sensors:
          type: integer
          format: int64
          description: Optional.  Number of sensor in task
          minimum: 1
          maximum: 100
    TaskDetailsDelayedMinutesRequest:
      type: object
      description: Object containing additional information about a task
      properties:
        name:
          type: string
          description: Required. Human readable name to identify the task
          minLength: 3
          maxLength: 64
          example: "Some task name"
        interval_minutes:
          type: integer
          format: int64
          description: Sensor sampling interval in minutes. Required if 'interval_seconds' not included or less than 15. Must be equal to or greater than 1 if the interval seconds is not included or less than 15
          minimum: 0
          maximum: 240
          example: 0
        interval_seconds:
          type: integer
          format: int64
          description: Sensor reading interval in seconds. Required if 'interval_minutes' not included. Must be greater than 0 if 'interval_minutes' included and equal or greater than 15 if not
          minimum: 0
          maximum: 59
          example: 15
        loop_reads:
          type: boolean
          description: Flag indicating whether to overwrite oldest data after 16,000 readings or not
          default: false
        start_delayed:
          $ref: '#/components/schemas/StartDelayedMinutesOptions'
        sensor_type:
          $ref: '#/components/schemas/SensorType'
        alarm_low_temp:
          type: number
          format: float
          example: 5.5
          description: Optional. Low sensor value threshold used to determine alarm conditions in celcius. Cannot be greater than 'alarm_high_temp'
          minimum: -40
          maximum: 84
        alarm_high_temp:
          type: number
          format: float
          example: 10.5
          description: Optional. High sensor value threshold used to determine alarm conditions in celcius. Cannot be lower than 'alarm_low_temp'
          minimum: -39
          maximum: 85
        notes:
          type: string
          example: "Human readable note as free text"
          description: Optional. Additional notes text for the task. String literal characters are accepted.
          maxLength: 1024
        low_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_seconds'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 60
          example: 10
        low_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_minutes'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 59
          example: 30
        high_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_seconds'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 60
          example: 10
        high_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_minutes'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 59
          example: 30
        required_sensors:
          type: integer
          format: int64
          description: Optional.  Number of sensor in task
          minimum: 1
          maximum: 100
    TaskDetailsDelayedUntilRequest:
      type: object
      description: Object containing additional information about a task
      properties:
        name:
          type: string
          description: Required. Human readable name to identify the task
          minLength: 3
          maxLength: 64
          example: "Some task name"
        interval_minutes:
          type: integer
          format: int64
          description: Sensor sampling interval in minutes. Required if 'interval_seconds' not included or less than 15. Must be equal to or greater than 1 if the interval seconds is not included or less than 15
          minimum: 0
          maximum: 240
          example: 0
        interval_seconds:
          type: integer
          format: int64
          description: Sensor reading interval in seconds. Required if 'interval_minutes' not included. Must be greater than 0 if 'interval_minutes' included and equal or greater than 15 if not
          minimum: 0
          maximum: 59
          example: 15
        loop_reads:
          type: boolean
          description: Flag indicating whether to overwrite oldest data after 16,000 readings or not
          default: false
        start_delayed:
          $ref: '#/components/schemas/StartDelayedUntilOptions'
        sensor_type:
          $ref: '#/components/schemas/SensorType'
        alarm_low_temp:
          type: number
          format: float
          example: 5.5
          description: Optional. Low sensor value threshold used to determine alarm conditions in celcius. Cannot be greater than 'alarm_high_temp'
          minimum: -40
          maximum: 84
        alarm_high_temp:
          type: number
          format: float
          example: 10.5
          description: Optional. High sensor value threshold used to determine alarm conditions in celcius. Cannot be lower than 'alarm_low_temp'
          minimum: -39
          maximum: 85
        notes:
          type: string
          example: "Human readable note as free text"
          description: Optional. Additional notes text for the task. String literal characters are accepted.
          maxLength: 1024
        low_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_seconds'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 60
          example: 10
        low_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_minutes'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 59
          example: 30
        high_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_seconds'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 60
          example: 10
        high_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_minutes'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 59
          example: 30
        required_sensors:
          type: integer
          format: int64
          description: Optional.  Number of sensor in task
          minimum: 1
          maximum: 100
    TaskDetailsResponse:
      type: object
      description: Object containing additional information about a task
      properties:
        name:
          type: string
          description: Human readable name to identify the task
          minLength: 3
          maxLength: 64
        created:
          type: string
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
          description: Read-only field server will set of when the task is created (YYYY-MM-DDTHH:mm:ss.SSSSSSZ)
        updated:
          type: string
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
          description: Read-only field server will set of when the task is updated (YYYY-MM-DDTHH:mm:ss.SSSSSSZ)
        interval_minutes:
          type: integer
          format: int64
          description: Sensor reading interval in minutes. Required if 'interval_seconds' is not included or is less than 15
          minimum: 0
          maximum: 240
        interval_seconds:
          type: integer
          format: int64
          description: Sensor reading interval in seconds. Required if 'interval_minutes' not included. Must be greater than 0 if 'interval_minutes' is included and equal or greater than 15 if not
          minimum: 0
          maximum: 59
        loop_reads:
          type: boolean
          description: Flag indicating whether to overwrite oldest data after 16,000 readings or not
          default: false
        start_immediately:
          $ref: '#/components/schemas/StartImmediateOptions'
        start_delayed:
          $ref: '#/components/schemas/StartDelayedOptions'
        sensor_type:
          $ref: '#/components/schemas/SensorType'
        alarm_low_temp:
          type: number
          format: float
          description: Optional. Low sensor value threshold used to determine alarm conditions in celcius. Cannot be greater than 'alarm_high_temp'
          minimum: -40
          maximum: 84
          example: 5.5
        alarm_high_temp:
          type: number
          format: float
          description: Optional. High sensor value threshold used to determine alarm conditions in celcius. Cannot be lower than 'alarm_low_temp'
          minimum: -39
          maximum: 85
          example: 10.5
        notes:
          type: string
          description: Optional. Additional notes for the task
          maxLength: 1024
        low_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_seconds'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 60
        low_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be below low threshold to cause an alarm to be generated. Can be used in combination with 'low_duration_minutes'. If none of the low duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_low_temp'.
          minimum: 0
          maximum: 59
        high_duration_minutes:
          type: integer
          format: int64
          description: Optional. Duration, in minutes, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_seconds'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 60
        high_duration_seconds:
          type: integer
          format: int64
          description: Optional. Duration, in seconds, that sensor must be above high threshold to cause an alarm to be generated. Can be used in combination with 'high_duration_minutes'. If none of the high duration fields are included, alarms will be generated immediately after the sensor reaches 'alarm_high_temp'.
          minimum: 0
          maximum: 59
        required_sensors:
          type: integer
          format: int64
          description: Optional - Number of sensor in task.
          minimum: 1
          maximum: 100
    StartImmediateOptions:
      type: object
      description: Required when the 'start_delayed' option is not included. Indicates that the task should start immediately upon loading. This object does not require a body. The 'start_immediately' and the 'start_delayed' options are mutually exclusive, i.e., these options should not both be present.
    StartDelayedOptions:
      type: object
      description: Required when the 'start_immediately' option is not included. The object contains conditions for delaying the start of a task. The conditions can be combined. The task begins whenever one of the conditions occurs.  The 'start_delayed' and the 'start_immediately' options are mutually exclusive, i.e., these options should not both be present.
      properties:
        on_button_press:
          type: boolean
          description: Optional. Starts after button press and hold for 3 seconds
          default: false
        delayed_temp_below:
          type: number
          format: float
          description: Optional. Temperature in celsius. The Task begins when the temperature is below this threshold
          minimum: -40
          maximum: 84
          example: 5.5
        delayed_temp_above:
          type: number
          format: float
          description: Optional. Temperature in celsius. The Task begins when the temperature is above this threshold
          minimum: -39
          maximum: 85
          example: 5.5
        delayed_minutes:
          type: integer
          format: int64
          description: Optional. Minutes to delay the start. The 'delayed_minutes' and the 'delayed_until' options are mutually exclusive, i.e., these options should not both be present
          minimum: 1
          maximum: 240
        delayed_until:
          type: string
          format: date-time
          example: "2022-10-28T05:41:43.006Z"
          description: Optional. The date until which the task is delayed, it must be a future date in the format of YYYY-MM-DDTHH:mm:ss.SSSZ. The 'delayed_minutes' and the 'delayed_until' options are mutually exclusive, i.e., these options should not both be present
    StartDelayedMinutesOptions:
      type: object
      description: Required if 'start_immediately' not included. Object containing conditions for delaying the start of a task. Properties can be combined, causing the sensor to enable the task whenever any of the conditions occur. When present, 'start_immediate' option cannot be included.
      properties:
        on_button_press:
          type: boolean
          description: Optional. Starts after button press and hold for 3 seconds
          default: false
        delayed_temp_below:
          type: number
          format: float
          description: Optional. Starts when temperature is below a threshold
          minimum: -40
          maximum: 84
          example: 5.5
        delayed_temp_above:
          type: number
          format: float
          description: Optional. Starts when temperature is above a threshold
          minimum: -39
          maximum: 85
          example: 5.5
        delayed_minutes:
          type: integer
          format: int64
          description: Optional. Minutes to delay the start
          minimum: 1
          maximum: 240
    StartDelayedUntilOptions:
      type: object
      description: Required if 'start_immediately' not included. Object containing conditions for delaying the start of a task. Properties can be combined, causing the sensor to enable the task whenever any of the conditions occur. When present, 'start_immediate' option cannot be included.
      properties:
        on_button_press:
          type: boolean
          description: Optional. Starts after button press and hold for 3 seconds
          default: false
        delayed_temp_below:
          type: number
          format: float
          description: Optional. Starts when temperature is below a threshold
          minimum: -40
          maximum: 84
          example: 5.5
        delayed_temp_above:
          type: number
          format: float
          description: Optional. Starts when temperature is above a threshold
          minimum: -39
          maximum: 85
          example: 5.5
        delayed_until:
          type: string
          format: date-time
          example: "2022-10-28T05:41:43.006Z"
          description: Optional. Date to which the start is delayed. It must be in the future (YYYY-MM-DDTHH:mm:ss.SSSZ)
    SensorType:
      type: string
      enum:
        - SENSOR_TYPE_TEMPERATURE
      default: SENSOR_TYPE_TEMPERATURE
      description: Enum for sensor types
    CreateTaskResponse:
      type: object
      properties:
        id:
          type: string
          title: ID of the created task
      example:
        id: 51f9b386-62d5-4867-9ba4-0e232936227e
    AddAssetRequest:
      type: object
      description: Request object used for creating an asset in a Task.
      properties:
        asset:
          type: string
        id_format:
          type: string
          enum:
            - ASSET_ID_FORMAT_FREE,
            - ASSET_ID_FORMAT_GS1_URI,
#            - ASSET_ID_FORMAT_GS1_HEX,
#            - ASSET_ID_FORMAT_GS1_BARCODE
    AddAssetResponse:
      type: object
      description: Response object after creating an asset.
      properties:
        asset_id:
          type: string
          example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
        task_asset_id:
          type: string
          example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'

    AssociateSensorRequest:
      type: object
      description: Request object used for associating sensors with a task
      properties:
        sensor_ids:
          type: array
          description: Required. IDs of the sensors to be associated with a task
          items:
            type: string
            format: 'uuid'
          example: ['04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a', '14a21952-cdcf-4bb2-bcaa-4e325f4b9a4a']
    AssociateSensorResponse:
      type: object
      description: Response object used for associating sensors with a task
      properties:
        associated_sensors:
          type: array
          description: Array of sensor id's associated with the task
          items:
            type: object
            properties:
              sensor_id:
                type: string
                example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
              sensor_task_id:
                type: string
                example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
        failed_sensors:
          type: array
          description: Arrays of sensor id's that could not be associated with the task
          items:
            type: object
            properties:
              sensor_id:
                type: string
                example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
              failed_sensor_error:
                type: string
                enum:
                  - FAILED_SENSOR_ERROR_SENSOR_LOW_BATTERY
                  - FAILED_SENSOR_ERROR_SENSOR_ACTIVE
                  - FAILED_SENSOR_ERROR_SENSOR_NOT_FOUND
                  - FAILED_SENSOR_ERROR_PENDING_UNENROLLMENT

    ListSensorsResponse:
      type: object
      description: Response object with filtered sensors and pagination details
      properties:
        sensors:
          type: array
          description: Filtered sensors array.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: ID of the sensor.
                example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
              mac_address:
                type: string
                description: MAC address of the sensor.
                example: '01757E1A0001'
              serial_number:
                type: string
                description: Serial number of the sensor.
                example: 'DLJ222801742'
              model:
                type: string
                description: Model of the sensor.
                example: 'ZS300-10001-000D'
              manufacturer:
                type: string
                description: Manufacturer of the sensor.
                example: 'Zebra Technologies'
              hardware_revision:
                type: string
                description: Hardware revision value of the sensor.
                example: '1'
              firmware_revision:
                type: string
                description: Firmware revision value of the sensor.
                example: 'D01.0.0.712'
              battery_level:
                type: integer
                description: Battery level of the sensor.
              additional_info:
                type: string
                description: Additional info about the sensor.
              name:
                type: string
                description: Name of the sensor.
                example: 'ZS300_DLJ222801742'
              status:
                type: string
                enum:
                  - SENSOR_STATUS_ACTIVE
                  - SENSOR_STATUS_ACTIVE_WITH_ALARM
                  - SENSOR_STATUS_STOPPED
                description: Current status of the sensor.
              alarm_count:
                type: integer
                description: Number of alarms recorded for the sensor.
                format: int64
              first_seen:
                type: string
                format: date-time
                example: "2022-10-28T05:41:43.620792Z"
                description: Registration date of the sensor (YYYY-MM-DDTHH:mm:ss.SSSSSSZ)
              last_updated:
                type: string
                format: date-time
                example: "2022-10-28T05:41:43.620792Z"
                description: Last activity date of the sensor in a task. Every time the sensor checks in, it gets updated (YYYY-MM-DDTHH:mm:ss.SSSSSSZ)
              notes:
                type: string
                description: Additional notes for the sensor.
                example: "This is a note example"
              certificate_url:
                type: string
                description: URL of the sensor's certificate document.
                example: 'https://certificate-url.example'
              most_recent:
                type: object
                description: The most recent task which the sensor has been associated with, if any
                properties:
                  task_id:
                    type: string
                    description: ID of the task.
                    format: uuid
                    example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
                  sensor_task_id:
                    type: string
                    description: ID of the sensor task.
                    format: uuid
                    example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
                  sensor_task_status:
                    type: string
                    enum:
                      - SENSOR_TASK_STATUS_START_PENDING
                      - SENSOR_TASK_STATUS_ACTIVE
                      - SENSOR_TASK_STATUS_ACTIVE_WITH_ALARM
                      - SENSOR_TASK_STATUS_COMPLETED
                      - SENSOR_TASK_STATUS_STOP_PENDING
                    description: Current status of the sensor task.
                  last_read_time:
                    type: string
                    description: Last date on which a sample's reading was successfully performed. Each time a read is executed, this date is updated to reflect the most recent reading (YYYY-MM-DDTHH:mm:ss.SSSSSSZ).
                    format: date-time
                    example: '2022-10-28T05:41:43.620792Z'
              requested:
                type: object
                description: The requested task which the sensor has been associated with, if any.
                properties:
                  task_id:
                    type: string
                    description: ID of the task.
                    format: uuid
                    example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
                  sensor_task_id:
                    type: string
                    description: ID of the sensor task.
                    format: uuid
                    example: '04a21952-cdcf-4bb2-bcaa-4e325f4b9a4a'
                  sensor_task_status:
                    type: string
                    enum:
                      - SENSOR_TASK_STATUS_START_PENDING
                      - SENSOR_TASK_STATUS_ACTIVE
                      - SENSOR_TASK_STATUS_ACTIVE_WITH_ALARM
                      - SENSOR_TASK_STATUS_COMPLETED
                      - SENSOR_TASK_STATUS_STOP_PENDING
                    description: Current status of the sensor task.
                  last_read_time:
                    type: string
                    description: Last date on which a sample's reading was successfully performed. Each time a read is executed, this date is updated to reflect the most recent reading (YYYY-MM-DDTHH:mm:ss.SSSSSSZ).
                    format: date-time
                    example: '2022-10-28T05:41:43.620792Z'
              certificate_type:
                type: string
                enum:
                  - CERTIFICATE_TYPE_CONFORMANCE
                  - CERTIFICATE_TYPE_CALIBRATION
                description: Type of the sensor's certificate.
              unverified:
                type: object
                description: Last temperature, date, time and alarm of the advertising packet.
                properties:
                  last_date_time:
                    type: string
                    format: date-time
                    example: "2023-01-10T06:12:11.6352243"
                  last_temperature:
                    type: number
                    format: float
                    example: 24.96
                  last_alarm:
                    type: boolean
                    example: true
        page_response:
          type: object
          description: Pagination details for further requests.
          properties:
            total_elements:
              type: integer
              description: Total number of elements available.
            size:
              type: integer
              description: Number of elements per page.
            total_pages:
              type: integer
              description: Total pages available.
            page:
              type: integer
              description: Current page number.
    ListTaskResponse:
      title: Response object containing the list of Tasks
      type: object
      properties:
        tasks:
          title: Returned Tasks
          type: array
          items:
            $ref: '#/components/schemas/TaskItem'
        page_response:
          $ref: '#/components/schemas/PageResponse'
    SensorEnrollmentRequest:
      type: object
      description: Request object used to request a sensor enrollment.
      properties:
        serial_number:
          type: string
          description: Required. The serial number of the sensor that should be enrolled. Its composed by 3 letters followed by 9 digits.
          example: ABC123456789
    SensorEnrollmentResponse:
      type: object
      description: Response object returned from a successful request of sensor enroll
    SensorUnenrollmentResponse:
      type: object
      description: Response object returned from a successful request of sensor unenroll
    PageResponse:
      type: object
      description: Object containing a page response. Usually used for pagination logic.
      properties:
        total_elements:
          type: string
          description: Total number of elements available.
          format: uint64
        size:
          type: integer
          description: Number of elements per page.
          format: int64
        total_pages:
          type: integer
          description: Total pages available.
          format: int64
        page:
          type: integer
          description: Page number.
          format: int64
    TaskResponse:
      type: object
      properties:
        id:
          type: string
          description: ID of the task.
        sensor_count:
          type: string
          description: Number of sensors of the task.
          format: uint64
        status:
          $ref: '#/components/schemas/TaskStatus'
        sensor_task_status_overview:
          $ref: '#/components/schemas/SensorTaskStatusOverview'
        started:
          type: string
          description: Start date of the task.
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
        ended:
          type: string
          description: End date of the task.
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
        taskDetails:
          $ref: '#/components/schemas/TaskDetails'
        alarm_count:
          type: string
          description: Number of alarms recorded for the task
          format: uint64
      description: Object containing information about a task.
    TaskItem:
      type: object
      properties:
        id:
          type: string
          description: ID of the task.
          example: "c2ab4e12-c6bb-4cfc-8d5f-a470e793254f"
        sensor_count:
          type: string
          description: Number of sensors of the task.
          format: uint64
        status:
          $ref: '#/components/schemas/TaskStatus'
        started:
          type: string
          description: Start date of the task.
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
        ended:
          type: string
          description: End date of the task.
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
        taskDetails:
          $ref: '#/components/schemas/TaskItemDetails'
        alarm_count:
          type: string
          description: Number of alarms recorded for the task
          format: uint64
      description: Object containing information about a task.
    TaskDetails:
      type: object
      properties:
        name:
          title: |-
            Human readable name to identify the task.
          type: string
        created:
          type: string
          description: Date-time when the task was created
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
        updated:
          type: string
          format: date-time
          description: Date-time when task was last updated
          example: "2022-10-28T05:41:43.620792Z"
        interval_minutes:
          title: Sensor reading interval in minutes
          type: integer
          format: int64
        interval_seconds:
          title: Sensor reading interval in seconds
          type: integer
          format: int64
        loop_reads:
          type: boolean
          description: |-
            Flag indicating whether to overwrite oldest data after 16,000 readings or
            not.
        start_immediately:
          $ref: '#/components/schemas/StartImmediateOptions'
        start_delayed:
          $ref: '#/components/schemas/StartDelayedOptions'
        sensor_type:
          $ref: '#/components/schemas/SensorType'
        alarm_low_temp:
          description: Temperature below which an alarm will occur
          type: number
          format: float
        alarm_high_temp:
          type: number
          format: float
          description: Temperature above which an alarm will occur
        notes:
          type: string
          description: Additional notes for the task.
        low_duration_minutes:
          type: integer
          format: int64
          description: The length of time, in minutes, that will elapse after the low temperature alarm threshold has been crossed before an alarm flag is raised
        low_duration_seconds:
          type: integer
          format: int64
          description: The length of time, in seconds, that will elapse after the low temperature alarm threshold has been crossed before an alarm flag is raised
        high_duration_minutes:
          type: integer
          format: int64
          description: The length of time, in minutes, that will elapse after the high temperature alarm threshold has been crossed before an alarm flag is raised
        high_duration_seconds:
          type: integer
          format: int64
          description: The length of time, in seconds, that will elapse after the high temperature alarm threshold has been crossed before an alarm flag is raised
        required_sensors:
          type: string
          format: uint64
          description: Number of sensors specified to be associated to the task
      description: Object containing additional information about a task.
    TaskItemDetails:
      type: object
      properties:
        name:
          title: |-
            Human readable name to identify the task. Required when creating a task
            template, is_reusable=true
          type: string
        created:
          type: string
          description: Read-only field server will set of when the task was created.
          format: date-time
        updated:
          type: string
          format: date-time
        notes:
          type: string
          description: Additional notes for the task.
        required_sensors:
          type: string
          format: uint64
      description: Object containing additional information about a task.
    GetTaskResponse:
      title: Response object containing the requested Task
      type: object
      properties:
        task:
          $ref: '#/components/schemas/TaskResponse'
    ListAlarmsResponse:
      title: Response object containing the list of Alarms for one Task
      type: object
      properties:
        page_response:
          $ref: '#/components/schemas/PageResponse'
        sensors_alarms:
          title: Returned list of Sensor Alarms
          type: array
          items:
            $ref: '#/components/schemas/SensorAlarm'
    SensorAlarm:
      title: Object containing information about a Sensor Alarm
      type: object
      properties:
        sensor_id:
          title: ID of the Sensor
          type: string
          example: "c2ab4e12-c6bb-4cfc-8d5f-a470e793254f"
        alarm_type:
          $ref: '#/components/schemas/AlarmType'
        occurred:
          title: Datetime when the alarm has occurred
          type: string
          format: date-time
          example: "2022-10-28T05:41:43.620792Z"
        temperature:
          title: Temperature value when the alarm has occurred
          type: number
          format: float
        sensor_name:
          title: Name of the Sensor
          type: string
    AlarmType:
      title: Enum with supported Alarm types
      type: string
      enum:
        - ALARM_TYPE_LOW_LIMIT_ALARM
        - ALARM_TYPE_HIGH_LIMIT_ALARM
        - ALARM_TYPE_LOW_BATTERY_ALARM
        - ALARM_TYPE_TOO_COLD