{
  "openapi" : "3.1.0",
  "info" : {
    "description" : "Allows configuration and issuing inspections",
    "title" : "Inspections",
    "version" : "1.0"
  },
  "externalDocs" : {
    "description" : "Trackunit Developer Hub",
    "url" : "https://developers.trackunit.com/"
  },
  "servers" : [ {
    "url" : "https://iris.trackunit.com/api/public/inspection",
    "description" : "API Endpoint"
  } ],
  "security" : [ {
    "authorizationBearer" : [ ]
  } ],
  "paths" : {
    "/accessible-inspection-templates" : {
      "get" : {
        "description" : "InspectionTemplates the authenticated operator has access to are InspectionTemplate that are assigned to assets the operator has keys for, for the period the key is valid.",
        "operationId" : "getAccessibleInspectionTemplates",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/InspectionTemplateRepresentation"
                  }
                }
              }
            },
            "description" : "A list of inspectionTemplates."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Returns those InspectionTemplates the operator has access to.",
        "tags" : [ "InspectionTemplates" ]
      }
    },
    "/images/upload" : {
      "post" : {
        "description" : "This endpoint is used to upload an image. Images need to be first registered which will return an URL for uploading.",
        "operationId" : "upload",
        "parameters" : [ {
          "in" : "query",
          "name" : "token",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        }, {
          "description" : "only needed for operators as they can be associated with several accounts",
          "in" : "query",
          "name" : "accountId",
          "required" : false,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "only needed for operators as they can be associated with several accounts"
          }
        } ],
        "requestBody" : {
          "content" : {
            "multipart/form-data" : {
              "schema" : {
                "type" : "object",
                "properties" : {
                  "file" : {
                    "type" : "string",
                    "format" : "binary"
                  }
                },
                "required" : [ "file" ]
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/UploadImageResponse"
                }
              }
            },
            "description" : "InspectionResponse was successfully created."
          }
        },
        "summary" : "Uploads an Image",
        "tags" : [ "Image" ]
      }
    },
    "/inspection-assignments" : {
      "get" : {
        "description" : "This API is used to query InspectionAssignments.",
        "operationId" : "getInspectionAssignments",
        "parameters" : [ {
          "description" : "If specified, only InspectionAssignments for given assets will be returned",
          "in" : "query",
          "name" : "assetIds",
          "required" : false,
          "schema" : {
            "type" : "array",
            "description" : "If specified, only InspectionAssignments for given assets will be returned",
            "items" : {
              "type" : "string",
              "format" : "uuid",
              "description" : "If specified, only InspectionAssignments for given assets will be returned"
            }
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "example" : 0,
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0,
            "minimum" : 0
          }
        }, {
          "description" : "The size of the page to be returned",
          "example" : 20,
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20,
            "minimum" : 1
          }
        }, {
          "description" : "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedInspectionAssignmentRepresentation"
                }
              }
            },
            "description" : "InspectionAssignments were queried successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get InspectionAssignments.",
        "tags" : [ "InspectionAssignments" ]
      },
      "post" : {
        "description" : "If you want to create an InspectionAssignment for an asset that already has an assignment then the existing InspectionAssignment will be updated to the new InspectionTemplate provided.\nThis API is used to create InspectionAssignment with specified properties.",
        "operationId" : "createInspectionAssignment",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateInspectionAssignmentRepresentation"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionAssignmentRepresentation"
                }
              }
            },
            "description" : "InspectionAssignment was created successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Create InspectionAssignment.",
        "tags" : [ "InspectionAssignments" ]
      }
    },
    "/inspection-assignments/{inspectionAssignmentId}" : {
      "delete" : {
        "description" : "This API is used to delete InspectionAssignment.",
        "operationId" : "deleteInspectionAssignment",
        "parameters" : [ {
          "description" : "The ID of InspectionAssignment to be deleted",
          "in" : "path",
          "name" : "inspectionAssignmentId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of InspectionAssignment to be deleted"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "InspectionAssignment was deleted successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Delete InspectionAssignment.",
        "tags" : [ "InspectionAssignments" ]
      },
      "get" : {
        "description" : "This API is used to retrieve InspectionAssignment details based on its ID.",
        "operationId" : "getInspectionAssignmentById",
        "parameters" : [ {
          "description" : "The ID of InspectionAssignment to be retrieved",
          "in" : "path",
          "name" : "inspectionAssignmentId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of InspectionAssignment to be retrieved"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionAssignmentRepresentation"
                }
              }
            },
            "description" : "InspectionAssignment was retrieved successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get InspectionAssignment by ID.",
        "tags" : [ "InspectionAssignments" ]
      }
    },
    "/inspection-responses" : {
      "get" : {
        "description" : "This API is used to retrieve available InspectionResponses.",
        "operationId" : "getInspectionResponses",
        "parameters" : [ {
          "description" : "If specified, only InspectionResponses for specified assets will be returned",
          "in" : "query",
          "name" : "assetIds",
          "required" : false,
          "schema" : {
            "type" : "array",
            "description" : "If specified, only InspectionResponses for specified assets will be returned",
            "items" : {
              "type" : "string",
              "format" : "uuid",
              "description" : "If specified, only InspectionResponses for specified assets will be returned"
            },
            "uniqueItems" : true
          }
        }, {
          "description" : "If specified, only InspectionResponses for specified operators will be returned",
          "in" : "query",
          "name" : "operatorIds",
          "required" : false,
          "schema" : {
            "type" : "array",
            "description" : "If specified, only InspectionResponses for specified operators will be returned",
            "items" : {
              "type" : "string",
              "format" : "uuid",
              "description" : "If specified, only InspectionResponses for specified operators will be returned"
            },
            "uniqueItems" : true
          }
        }, {
          "description" : "If specified, only InspectionResponses for specified inspection templates will be returned",
          "in" : "query",
          "name" : "inspectionTemplateIds",
          "required" : false,
          "schema" : {
            "type" : "array",
            "description" : "If specified, only InspectionResponses for specified inspection templates will be returned",
            "items" : {
              "type" : "string",
              "format" : "uuid",
              "description" : "If specified, only InspectionResponses for specified inspection templates will be returned"
            },
            "uniqueItems" : true
          }
        }, {
          "description" : "If specified, only InspectionResponses with specified statuses will be returned",
          "in" : "query",
          "name" : "inspectionResponseStatuses",
          "required" : false,
          "schema" : {
            "type" : "array",
            "description" : "If specified, only InspectionResponses with specified statuses will be returned",
            "items" : {
              "type" : "string",
              "description" : "Enumerates the possible statuses of an InspectionResponse, with the potential for more to be added in the future.",
              "enum" : [ "FAILED_CRITICAL", "FAILED_LOW", "PASSED", "SKIPPED" ]
            },
            "uniqueItems" : true
          }
        }, {
          "description" : "If specified, limits returned InspectionResponses to ones with end time after specified instant",
          "in" : "query",
          "name" : "endTimeFrom",
          "required" : false,
          "schema" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "If specified, limits returned InspectionResponses to ones with end time after specified instant"
          }
        }, {
          "description" : "If specified, limits returned InspectionResponses to ones with end time before specified instant",
          "in" : "query",
          "name" : "endTimeTo",
          "required" : false,
          "schema" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "If specified, limits returned InspectionResponses to ones with end time before specified instant"
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "example" : 0,
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0,
            "minimum" : 0
          }
        }, {
          "description" : "The size of the page to be returned",
          "example" : 20,
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20,
            "minimum" : 1
          }
        }, {
          "description" : "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedInspectionResponseRepresentation"
                }
              }
            },
            "description" : "Inspections queried successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Retrieve InspectionResponses.",
        "tags" : [ "InspectionResponses" ]
      },
      "post" : {
        "description" : "Submit InspectionResponse. This mutation is usually used by operator applications (mobile).\nThe idea is that the operator will answer all questions and submit the InspectionResponse, consisting of an answer\nfor each question. Please note that this endpoint allows the operator to submit an InspectionResponse for an asset\nthat does not have an active InspectionAssignment or with an outdated InspectionTemplateVersion. This is intentional\nto allow the operator inspections even in remote areas with poor internet connection and pre-downloaded\nInspectionTemplates. In that case the InspectionResponse can be stored locally on the device until\ninternet connection is available and the response can be submitted.\n\nThis API is used to create InspectionResponse, or in other words: submitting result of performed inspection.",
        "operationId" : "createInspectionResponse",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateInspectionResponseRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionResponseRepresentation"
                }
              }
            },
            "description" : "Inspections submitted successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Creates InspectionResponses.",
        "tags" : [ "InspectionResponses" ]
      }
    },
    "/inspection-responses/{inspectionResponseId}" : {
      "get" : {
        "description" : "This API is used to retrieve InspectionResponse by its ID.",
        "operationId" : "getInspectionResponseById",
        "parameters" : [ {
          "description" : "The ID of the InspectionResponse to be retrieved",
          "in" : "path",
          "name" : "inspectionResponseId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionResponse to be retrieved"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionResponseRepresentation"
                }
              }
            },
            "description" : "InspectionResponse retrieved successfully."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Fetch InspectionResponse by its ID.",
        "tags" : [ "InspectionResponses" ]
      }
    },
    "/inspection-responses/{inspectionResponseId}/answers/{answerId}/images/" : {
      "post" : {
        "description" : "Users can attach images to existing responses.\n",
        "operationId" : "deleteInspectionQuestionImage",
        "parameters" : [ {
          "in" : "path",
          "name" : "inspectionResponseId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "in" : "path",
          "name" : "answerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "202" : {
            "description" : "Image upload request submitted successfully"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Upload InspectionResponse image",
        "tags" : [ "InspectionResponses" ]
      }
    },
    "/inspection-templates" : {
      "get" : {
        "description" : "Retrieve a list of all InspectionTemplates without their versions. Details such as questions are retrieved through other endpoints using the template ID.",
        "operationId" : "getInspectionTemplates",
        "parameters" : [ {
          "description" : "Filter case-insensitive templates by name containing the specified parameter.",
          "in" : "query",
          "name" : "name",
          "required" : false,
          "schema" : {
            "type" : "string",
            "description" : "Filter case-insensitive templates by name containing the specified parameter."
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "example" : 0,
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0,
            "minimum" : 0
          }
        }, {
          "description" : "The size of the page to be returned",
          "example" : 20,
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20,
            "minimum" : 1
          }
        }, {
          "description" : "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedInspectionTemplateRepresentation"
                }
              }
            },
            "description" : "List of all InspectionTemplates."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get all InspectionTemplates.",
        "tags" : [ "InspectionTemplates" ]
      },
      "post" : {
        "description" : "Create a new InspectionTemplate.",
        "operationId" : "createInspectionTemplate",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateInspectionTemplateRepresentation"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionTemplateVersionRepresentation"
                }
              }
            },
            "description" : "New InspectionTemplate created."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Create a new InspectionTemplate.",
        "tags" : [ "InspectionTemplates" ]
      }
    },
    "/inspection-templates/versions/{inspectionTemplateVersionId}" : {
      "get" : {
        "description" : "Retrieve details of a specific InspectionTemplateVersion using its ID.",
        "operationId" : "getInspectionTemplateVersion",
        "parameters" : [ {
          "description" : "ID of the InspectionTemplate",
          "in" : "path",
          "name" : "inspectionTemplateVersionId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of the InspectionTemplate"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionTemplateVersionRepresentation"
                }
              }
            },
            "description" : "Details of the specified version of the InspectionTemplate."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get specific version of an InspectionTemplate via an ID.",
        "tags" : [ "InspectionTemplateVersions" ]
      }
    },
    "/inspection-templates/{inspectionTemplateId}" : {
      "delete" : {
        "description" : "Deletes InspectionTemplate along with all versions and responses that were submitted for this template.",
        "operationId" : "deleteInspectionTemplate",
        "parameters" : [ {
          "description" : "ID of the InspectionTemplate",
          "in" : "path",
          "name" : "inspectionTemplateId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of the InspectionTemplate"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Deletes InspectionTemplate.",
        "tags" : [ "InspectionTemplates" ]
      },
      "post" : {
        "description" : "Create a new version of an existing InspectionTemplate using its ID.",
        "operationId" : "createInspectionTemplateVersion",
        "parameters" : [ {
          "description" : "ID of the InspectionTemplate to create a new version for.",
          "in" : "path",
          "name" : "inspectionTemplateId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of the InspectionTemplate to create a new version for."
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateInspectionTemplateVersionRepresentation"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionTemplateVersionRepresentation"
                }
              }
            },
            "description" : "New version of the InspectionTemplate created."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Create a new version of an InspectionTemplate.",
        "tags" : [ "InspectionTemplateVersions" ]
      }
    },
    "/inspection-templates/{inspectionTemplateId}/current-version" : {
      "get" : {
        "description" : "Retrieve the current/lastest version details of an InspectionTemplate using its ID.",
        "operationId" : "getInspectionTemplateCurrentVersion",
        "parameters" : [ {
          "description" : "ID of the InspectionTemplate",
          "in" : "path",
          "name" : "inspectionTemplateId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of the InspectionTemplate"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionTemplateVersionRepresentation"
                }
              }
            },
            "description" : "Current version details of the specified InspectionTemplate."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get current version of an InspectionTemplate.",
        "tags" : [ "InspectionTemplates" ]
      }
    },
    "/inspection-templates/{inspectionTemplateId}/versions" : {
      "get" : {
        "description" : "Retrieve all version details of an InspectionTemplate using its ID.",
        "operationId" : "getInspectionTemplateVersions",
        "parameters" : [ {
          "description" : "ID of the InspectionTemplate",
          "in" : "path",
          "name" : "inspectionTemplateId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of the InspectionTemplate"
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "example" : 0,
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0,
            "minimum" : 0
          }
        }, {
          "description" : "The size of the page to be returned",
          "example" : 20,
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20,
            "minimum" : 1
          }
        }, {
          "description" : "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedInspectionTemplateVersionRepresentation"
                }
              }
            },
            "description" : "All version details of the specified InspectionTemplateVersion."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get all versions of an InspectionTemplate.",
        "tags" : [ "InspectionTemplateVersions" ]
      }
    },
    "/inspection-templates/{inspectionTemplateId}/versions/{version}" : {
      "get" : {
        "description" : "Retrieve details of a specific version of an InspectionTemplate using its ID and version number.",
        "operationId" : "getInspectionTemplateSpecificVersion",
        "parameters" : [ {
          "description" : "ID of the InspectionTemplate",
          "in" : "path",
          "name" : "inspectionTemplateId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of the InspectionTemplate"
          }
        }, {
          "description" : "Version number of the InspectionTemplate",
          "in" : "path",
          "name" : "version",
          "required" : true,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Version number of the InspectionTemplate"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/InspectionTemplateVersionRepresentation"
                }
              }
            },
            "description" : "Details of the specified version of the InspectionTemplate."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get specific version of an InspectionTemplate.",
        "tags" : [ "InspectionTemplateVersions" ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "AnswerRepresentation" : {
        "type" : "object",
        "description" : "An answer to a question. Answers are part of InspectionResponse.",
        "properties" : {
          "answer" : {
            "type" : "string",
            "description" : "The answer as a simple string."
          },
          "criticality" : {
            "type" : "string",
            "description" : "The criticality of the answer.",
            "enum" : [ "FAILED_CRITICAL", "FAILED_LOW", "PASSED" ]
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Answer UUID."
          },
          "imageReferences" : {
            "type" : "array",
            "description" : "The images that were uploaded as part of the answer.",
            "items" : {
              "$ref" : "#/components/schemas/InspectionImageReferenceRepresentation"
            },
            "uniqueItems" : true
          },
          "questionId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the question this answer is for."
          }
        },
        "required" : [ "answer", "criticality", "id", "imageReferences", "questionId" ]
      },
      "ConstraintViolationError" : {
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : [ "string", "null" ],
            "description" : "Alphanumeric code (snake case) describing use case specific error"
          },
          "message" : {
            "type" : "string",
            "description" : "Detailed description of error"
          },
          "properties" : {
            "type" : [ "object", "null" ],
            "additionalProperties" : { },
            "description" : "Additional properties to be included in the error response"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code"
          },
          "violations" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Violation"
            }
          }
        }
      },
      "CreateInspectionAssignmentRepresentation" : {
        "type" : "object",
        "description" : "Create InspectionAssignment. Please note: If you want to create an InspectionAssignment for an asset that already has an assignment, then the existing assignment will be updated to the new template provided.",
        "properties" : {
          "assetId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the asset to be the target of inspections based on this InspectionAssignment"
          },
          "inspectionTemplateId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionTemplate to be used for inspections based on this InspectionAssignment"
          }
        },
        "required" : [ "assetId", "inspectionTemplateId" ]
      },
      "CreateInspectionImageRepresentation" : {
        "type" : "object",
        "description" : "The representation of an image attached to an inspection, either in a question or in an answer.",
        "properties" : {
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "ID of already uploaded image. If a new image will be uploaded, this should be left empty."
          },
          "name" : {
            "type" : "string",
            "description" : "Custom name of the attached image. Can be used to reference a specific image, e.g. when several image representations are created at the same time."
          }
        }
      },
      "CreateInspectionResponseRequest" : {
        "type" : "object",
        "description" : "Submit an InspectionResponse. This is usually used by Operator applications (normally done via mobile app). The idea is that the operator will answer all questions and submit the InspectionResponse, including an answer per question. Please note that this allows the operator to submit an InspectionResponse for an asset that does not have an active InspectionAssignment or with an outdated template version.",
        "properties" : {
          "accountId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The Id of the account that operatorID was operating for."
          },
          "answers" : {
            "type" : "array",
            "description" : "Answers to questions in the template. Each question requires an answer.",
            "items" : {
              "$ref" : "#/components/schemas/AnswerRepresentation"
            }
          },
          "assetId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The Id of the asset that was inspected."
          },
          "endTime" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "When was this inspection completed."
          },
          "inspectionTemplateVersionId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionTemplateVersion for this InspectionResponse to."
          },
          "location" : {
            "$ref" : "#/components/schemas/LocationRepresentation",
            "description" : "Location where the inspection was conducted (if available)."
          },
          "startTime" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "When was this inspection initiated."
          },
          "status" : {
            "type" : "string",
            "description" : "Status of the InspectionResponse.",
            "enum" : [ "FAILED_CRITICAL", "FAILED_LOW", "PASSED", "SKIPPED" ]
          }
        },
        "required" : [ "accountId", "answers", "assetId", "endTime", "inspectionTemplateVersionId", "startTime", "status" ]
      },
      "CreateInspectionTemplateRepresentation" : {
        "type" : "object",
        "description" : "Create InspectionTemplate. An InspectionTemplate is the questionnaire that will be asked during an inspection.",
        "properties" : {
          "name" : {
            "type" : "string",
            "description" : "The name of the InspectionTemplate"
          },
          "questionGroups" : {
            "type" : "array",
            "description" : "The question groups that the InspectionTemplateVersion contains.",
            "items" : {
              "$ref" : "#/components/schemas/CreateQuestionGroupRepresentation"
            }
          }
        },
        "required" : [ "name", "questionGroups" ]
      },
      "CreateInspectionTemplateVersionRepresentation" : {
        "type" : "object",
        "description" : "Create new InspectionTemplate version for existing InspectionTemplate. This representation is used to update the questions of the InspectionTemplate. Please note that InspectionTemplateVersions are immutable. You cannot update an existing InspectionTemplateVersion as submissions might be based on previous versions of a template.",
        "properties" : {
          "questionGroups" : {
            "type" : "array",
            "description" : "The question groups that the InspectionTemplateVersion contains.",
            "items" : {
              "$ref" : "#/components/schemas/CreateQuestionGroupRepresentation"
            }
          }
        },
        "required" : [ "questionGroups" ]
      },
      "CreateNumericQuestionRepresentation" : {
        "type" : "object",
        "allOf" : [ {
          "$ref" : "#/components/schemas/QuestionRepresentation"
        }, {
          "type" : "object",
          "properties" : {
            "description" : {
              "type" : "string",
              "description" : "A description for the question."
            },
            "images" : {
              "type" : "array",
              "description" : "Images that are part of the question.",
              "items" : {
                "$ref" : "#/components/schemas/CreateInspectionImageRepresentation"
              }
            },
            "lowerCriticalThreshold" : {
              "type" : "number",
              "format" : "double",
              "description" : "An answer will result to FAILED_CRITICAL if below this value.",
              "example" : -5.0
            },
            "lowerWarningThreshold" : {
              "type" : "number",
              "format" : "double",
              "description" : "An answer will result to FAILED_LOW if below this value but above lowerCriticalThreshold.",
              "example" : -2.0
            },
            "question" : {
              "type" : "string",
              "description" : "The question the user has to answer."
            },
            "title" : {
              "type" : "string",
              "description" : "A title for the question."
            },
            "unit" : {
              "type" : "string",
              "description" : "The unit of the thresholds, e.g., m/s.",
              "example" : "m/s"
            },
            "upperCriticalThreshold" : {
              "type" : "number",
              "format" : "double",
              "description" : "An answer will result to FAILED_CRITICAL if above this value.",
              "example" : 5.0
            },
            "upperWarningThreshold" : {
              "type" : "number",
              "format" : "double",
              "description" : "An answer will result to FAILED_LOW if above this value but below upperCriticalThreshold.",
              "example" : 2.0
            }
          }
        } ],
        "description" : "Define a NumericQuestion. NumericQuestions can have thresholds for warnings and criticality. It is intended that the operator provides the value, and the system will evaluate the answer based on thresholds. For example, the answer will result to PASSED if between the two warningTrashholds.",
        "required" : [ "description", "images", "question", "title" ]
      },
      "CreateQuestionGroupRepresentation" : {
        "type" : "object",
        "description" : "A group of questions. A QuestionGroup represents a section in the inspection questionnaire, that is a section of an InspectionTemplateVersion.",
        "properties" : {
          "description" : {
            "type" : "string",
            "description" : "The QuestionGroup description."
          },
          "questions" : {
            "type" : "array",
            "description" : "The questions for this QuestionGroup.",
            "items" : {
              "oneOf" : [ {
                "$ref" : "#/components/schemas/CreateSingleChoiceQuestionRepresentation"
              } ]
            }
          },
          "title" : {
            "type" : "string",
            "description" : "The QuestionGroup title."
          }
        },
        "required" : [ "description", "questions", "title" ]
      },
      "CreateQuestionRepresentation" : {
        "type" : "object",
        "description" : "This type is a parent type of all possible questions.",
        "discriminator" : {
          "mapping" : {
            "NUMBER" : "#/components/schemas/CreateNumericQuestionRepresentation",
            "SINGLE_CHOICE" : "#/components/schemas/CreateSingleChoiceQuestionRepresentation"
          },
          "propertyName" : "type"
        },
        "properties" : {
          "description" : {
            "type" : "string",
            "description" : "A description for the question."
          },
          "images" : {
            "type" : "array",
            "description" : "Images that are part of the question.",
            "items" : {
              "$ref" : "#/components/schemas/CreateInspectionImageRepresentation"
            }
          },
          "question" : {
            "type" : "string",
            "description" : "The question the user has to answer."
          },
          "title" : {
            "type" : "string",
            "description" : "A title for the question."
          },
          "type" : {
            "type" : "string"
          }
        },
        "required" : [ "description", "images", "question", "title", "type" ]
      },
      "CreateSingleChoiceQuestionRepresentation" : {
        "allOf" : [ {
          "$ref" : "#/components/schemas/CreateQuestionRepresentation"
        } ],
        "description" : "Representation of a single-choice question to be created.",
        "required" : [ "choices", "description", "images", "question", "title" ]
      },
      "DefaultError" : {
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : [ "string", "null" ],
            "description" : "Alphanumeric code (snake case) describing use case specific error"
          },
          "message" : {
            "type" : "string",
            "description" : "Detailed description of error"
          },
          "properties" : {
            "type" : [ "object", "null" ],
            "additionalProperties" : { },
            "description" : "Additional properties to be included in the error response"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code"
          }
        }
      },
      "InspectionAssignmentRepresentation" : {
        "type" : "object",
        "description" : "InspectionAssignments are used to assign a particular InspectionTemplate to an asset. Each asset can have only one active InspectionAssignment for any account and therefore only one template at a time.",
        "properties" : {
          "assetId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the asset to be the target of inspections based on this InspectionAssignment."
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of this InspectionAssignment."
          },
          "inspectionTemplateId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionTemplate to be used for inspections based on this InspectionAssignment."
          }
        },
        "required" : [ "assetId", "id", "inspectionTemplateId" ]
      },
      "InspectionImageReferenceRepresentation" : {
        "type" : "object",
        "description" : "The representation of an image attached to an inspection, either in an InspectionQuestion or in an InspectionAnswer.",
        "properties" : {
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the uploaded image."
          },
          "imageDataAvailable" : {
            "type" : "boolean",
            "description" : "Is the image data uploaded successfully)."
          },
          "name" : {
            "type" : "string",
            "description" : "Custom name of the attached image, to be provided by client."
          },
          "uploadUrl" : {
            "type" : "string",
            "description" : "The URL to upload an image."
          },
          "url" : {
            "type" : "string",
            "description" : "The URL to download an image."
          }
        }
      },
      "InspectionResponseRepresentation" : {
        "type" : "object",
        "description" : "A data representation of the InspectionResponse, detailing the outcome and relevant information collected during the inspection process. An InspectionResponse provides the answers that were provided during an inspection of an asset.",
        "properties" : {
          "accountId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the Account that owns the data."
          },
          "answers" : {
            "type" : "array",
            "description" : "The set of answers provided during the inspection.",
            "items" : {
              "$ref" : "#/components/schemas/AnswerRepresentation"
            },
            "uniqueItems" : true
          },
          "assetId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the Asset that was inspected."
          },
          "endTime" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "The timestamp indicating when the inspection was concluded."
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionResponse."
          },
          "inspectionTemplateVersionId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the used InspectionTemplateVersion (Questionnaire) used for the inspection."
          },
          "location" : {
            "$ref" : "#/components/schemas/LocationRepresentation",
            "description" : "The geographical location where the inspection took place."
          },
          "operatorId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the Operator who initiated the inspection."
          },
          "startTime" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "The timestamp marking the start of the inspection."
          },
          "status" : {
            "type" : "string",
            "description" : "The status of the InspectionResponse.",
            "enum" : [ "FAILED_CRITICAL", "FAILED_LOW", "PASSED", "SKIPPED" ]
          }
        },
        "required" : [ "accountId", "answers", "assetId", "endTime", "id", "inspectionTemplateVersionId", "operatorId", "startTime", "status" ]
      },
      "InspectionTemplateRepresentation" : {
        "type" : "object",
        "description" : "InspectionsTemplates are describing which questions will be asked to the operator during an inspection. Templates are versioned, and the latest version of a template should be used for all new inspections.",
        "properties" : {
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionTemplate."
          },
          "name" : {
            "type" : "string",
            "description" : "The name of the InspectionTemplate."
          },
          "timeCreated" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Date of creation."
          },
          "timeUpdated" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "When the template was modified last time - excluding creation of new version."
          }
        },
        "required" : [ "id" ]
      },
      "InspectionTemplateVersionRepresentation" : {
        "type" : "object",
        "description" : "A particular version of an InspectionTemplate. The InspectionTemplateVersion is a questionnaire as it contains the questions that will be asked during an inspection. A version is immutable. Create a new version for the same template if you want to update any question.",
        "properties" : {
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the InspectionTemplateVersion."
          },
          "inspectionTemplate" : {
            "$ref" : "#/components/schemas/InspectionTemplateRepresentation",
            "description" : "The owning InspectionTemplate."
          },
          "questionGroups" : {
            "type" : "array",
            "description" : "The QuestionGroups that the InspectionTemplateVersion contains.",
            "items" : {
              "$ref" : "#/components/schemas/QuestionGroupRepresentation"
            }
          },
          "timeCreated" : {
            "type" : "string",
            "format" : "date-time",
            "description" : "Date of creation."
          },
          "version" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The version of the InspectionTemplateVersion."
          }
        },
        "required" : [ "id", "version" ]
      },
      "LocationRepresentation" : {
        "type" : "object",
        "description" : "A data representation of the geographical location where an inspection was conducted.",
        "properties" : {
          "latitude" : {
            "type" : "number",
            "format" : "double",
            "description" : "The latitude of the location."
          },
          "longitude" : {
            "type" : "number",
            "format" : "double",
            "description" : "The longitude of the location."
          }
        },
        "required" : [ "latitude", "longitude" ]
      },
      "NumericQuestionRepresentation" : {
        "allOf" : [ {
          "$ref" : "#/components/schemas/QuestionRepresentation"
        } ],
        "description" : "A NumericQuestionRepresentation with a numeric answer. The answer status will be evaluated based on thresholds. If no threshold is reached, the status will be PASSED.",
        "required" : [ "id" ]
      },
      "PaginatedInspectionAssignmentRepresentation" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/InspectionAssignmentRepresentation"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "PaginatedInspectionResponseRepresentation" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/InspectionResponseRepresentation"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "PaginatedInspectionTemplateRepresentation" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/InspectionTemplateRepresentation"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "PaginatedInspectionTemplateVersionRepresentation" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/InspectionTemplateVersionRepresentation"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "QuestionGroupRepresentation" : {
        "type" : "object",
        "description" : "A group of questions. A QuestionGroup represents a section in the InspectionTemplate.",
        "properties" : {
          "description" : {
            "type" : "string",
            "description" : "A short description of the QuestionGroup."
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the QuestionGroup."
          },
          "questions" : {
            "type" : "array",
            "description" : "The questions of the QuestionGroup. Questions have an order. Preserve the order of this list when presenting the QuestionGroups to the operator.",
            "items" : {
              "oneOf" : [ {
                "$ref" : "#/components/schemas/NumericQuestionRepresentation"
              }, {
                "$ref" : "#/components/schemas/SingleChoiceQuestionRepresentation"
              } ]
            }
          },
          "title" : {
            "type" : "string",
            "description" : "The title of the QuestionGroup."
          }
        },
        "required" : [ "id" ]
      },
      "QuestionRepresentation" : {
        "type" : "object",
        "description" : "Type of question",
        "discriminator" : {
          "mapping" : {
            "NUMERIC" : "#/components/schemas/NumericQuestionRepresentation",
            "SINGLE_CHOICE" : "#/components/schemas/SingleChoiceQuestionRepresentation"
          },
          "propertyName" : "type"
        },
        "properties" : {
          "description" : {
            "type" : "string",
            "description" : "The description of the question."
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "The ID of the question."
          },
          "images" : {
            "type" : "array",
            "description" : "The images of the question.",
            "items" : {
              "$ref" : "#/components/schemas/InspectionImageReferenceRepresentation"
            }
          },
          "question" : {
            "type" : "string",
            "description" : "The question text."
          },
          "title" : {
            "type" : "string",
            "description" : "The title of the question."
          },
          "type" : {
            "type" : "string",
            "description" : "The type of question.",
            "enum" : [ "SINGLE_CHOICE", "NUMERIC" ]
          }
        },
        "required" : [ "id" ]
      },
      "SingleChoiceQuestionRepresentation" : {
        "allOf" : [ {
          "$ref" : "#/components/schemas/QuestionRepresentation"
        } ],
        "description" : "A question with multiple possible answers but allowing only one answer to be selected. It is simple to create a boolean question with this type by providing two options, one with a problematic choice and one with a passing choice.",
        "required" : [ "choices", "id" ]
      },
      "UploadImageResponse" : {
        "type" : "object",
        "properties" : {
          "imageId" : {
            "type" : "string",
            "format" : "uuid"
          }
        }
      },
      "Violation" : {
        "type" : "object",
        "properties" : {
          "field" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          }
        }
      }
    },
    "securitySchemes" : {
      "authorizationBearer" : {
        "bearerFormat" : "JWT",
        "scheme" : "bearer",
        "type" : "http"
      }
    }
  }
}