{
  "openapi": "3.1.0",
  "info": {
    "description": "This API supports working with operators.",
    "title": "Operators",
    "version": "1.0"
  },
  "externalDocs": {
    "description": "Trackunit Developer Hub",
    "url": "https://developers.trackunit.com/"
  },
  "servers": [
    {
      "url": "https://iris.trackunit.com/api/operator",
      "description": "Endpoint for production"
    }
  ],
  "security": [
    {
      "authorizationBearer": []
    }
  ],
  "paths": {
    "/invitations": {
      "post": {
        "description": "This will create an invitation.\n",
        "operationId": "createInvitation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "9HzDLUxZ",
                  "accountId": "b55558ec-08d7-4a27-b821-eda8142f4f43",
                  "accountName": "Trackunit Construction",
                  "creatorName": "John Doe",
                  "creatorEmail": "john.doe@trackunit.com"
                },
                "schema": {
                  "$ref": "#/components/schemas/Invitation",
                  "description": "The Invitation you just created"
                }
              }
            },
            "description": "Invitation created successfully"
          },
          "401": {
            "content": {
              "*/*": {
                "example": {
                  "status": 401,
                  "code": "invalid_token",
                  "message": "Invalid JWT serialization: Missing dot delimiter(s)"
                }
              }
            },
            "description": "Token was missing, invalid or expired."
          },
          "403": {
            "description": "The token does not give access to do the operation."
          },
          "500": {
            "content": {
              "*/*": {
                "example": {
                  "message": "Unexpected error",
                  "errors": [],
                  "status": "INTERNAL_SERVER_ERROR"
                }
              }
            },
            "description": "Internal server error"
          }
        },
        "summary": "Create invitation",
        "tags": ["Invitations"]
      }
    },
    "/operators": {
      "get": {
        "description": "Gets all operators. The endpoint uses [cursor based pagination](/docs/reference/rest-apis-overview/pagination#cursor-based-pagination).",
        "operationId": "getOperatorsForAccount",
        "parameters": [
          {
            "description": "Set to **true** to only get key administrators",
            "in": "query",
            "name": "key-admins-only",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "description": "Filter to get only operators where display name, email or phone number starts with this parameter",
            "in": "query",
            "name": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter to get only operators where the invitation status is equal to this parameter value",
            "in": "query",
            "name": "operatorStatus",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["INVITED", "NOT_INVITED", "REJECTED", "LINKED"]
            }
          },
          {
            "description": "Filter to get only operators where phone number is equal to this parameter value",
            "in": "query",
            "name": "phoneNumber",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "allowEmptyValue": true,
            "description": "The cursor that points to the start of the page of data that has been returned.",
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "type": "string",
              "minimum": 0
            }
          },
          {
            "allowEmptyValue": true,
            "description": "The cursor that points to the end of the page of data that has been returned.",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "allowEmptyValue": true,
            "description": "The number of individual objects that are returned in each page.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "string",
              "maximum": 200,
              "minimum": 1
            }
          },
          {
            "allowEmptyValue": true,
            "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": {
              "application/json": {
                "example": {
                  "after": "00uqa2ps1dFVJNS0U252",
                  "limit": 2,
                  "content": [
                    {
                      "id": "e8b68fe9-df45-4b94-a889-c8e3e2ceda6f",
                      "displayName": "John Smith",
                      "email": "john.smith@example.com",
                      "phone": "+4511223344",
                      "accountId": "006dcc98-a02c-4169-b1d4-f2b921f88bb3",
                      "isKeyAdmin": true,
                      "operatorStatus": "LINKED"
                    },
                    {
                      "id": "7e56fa98-72ed-42a1-a534-e0fcfa9e0745",
                      "displayName": "Lars Hoegh",
                      "email": "person@trackunit.com",
                      "phone": "+4598765432",
                      "accountId": "006dcc98-a02c-4169-b1d4-f2b921f88bb3",
                      "isKeyAdmin": false,
                      "operatorStatus": "NOT_INVITED"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCursorOperatorRepresentation",
                  "description": "List of operators the user has access to."
                }
              }
            },
            "description": "Returns a page of the operator that matches the filters."
          },
          "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 operators",
        "tags": ["Operators"]
      },
      "post": {
        "description": "Creates a new operator, the payload is optional.",
        "operationId": "saveOperator",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOperatorRepresentation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "e8b68fe9-df45-4b94-a889-c8e3e2ceda6f",
                  "displayName": "John Smith",
                  "email": "john.smith@example.com",
                  "phone": "+4511223344",
                  "accountId": "006dcc98-a02c-4169-b1d4-f2b921f88bb3",
                  "isKeyAdmin": false,
                  "operatorStatus": "NOT_INVITED"
                },
                "schema": {
                  "$ref": "#/components/schemas/AccountOperatorRepresentation",
                  "description": "The created operator"
                }
              }
            },
            "description": "A newly created operator"
          },
          "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 operator",
        "tags": ["Operators"]
      }
    },
    "/operators/{operatorId}": {
      "delete": {
        "description": "Deletes operator",
        "operationId": "deleteOperatorById",
        "parameters": [
          {
            "description": "Id of the operator",
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operator 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 operator",
        "tags": ["Operators"]
      },
      "get": {
        "description": "Gets operator based on the id. Result can be Account or Independent Operator",
        "operationId": "getOperatorById",
        "parameters": [
          {
            "description": "Id of the operator.",
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "e8b68fe9-df45-4b94-a889-c8e3e2ceda6f",
                  "displayName": "John Smith",
                  "email": "john.smith@example.com",
                  "phone": "+4511223344",
                  "accountId": "006dcc98-a02c-4169-b1d4-f2b921f88bb3",
                  "isKeyAdmin": false,
                  "operatorStatus": "LINKED"
                },
                "schema": {
                  "$ref": "#/components/schemas/AccountOperatorRepresentation",
                  "description": "The requested operator"
                }
              }
            },
            "description": "Returns the requested operator."
          },
          "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 operator",
        "tags": ["Operators"]
      },
      "patch": {
        "description": "Users can update an operator with a subset of the attributes.",
        "operationId": "updateOperator",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartlyUpdateOperatorRepresentation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "id": "e8b68fe9-df45-4b94-a889-c8e3e2ceda6f",
                  "displayName": "Sarah Connor",
                  "email": ""
                },
                "schema": {
                  "description": "The updated operator",
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AccountOperatorRepresentation"
                    },
                    {
                      "$ref": "#/components/schemas/IndependentOperatorRepresentation"
                    }
                  ]
                }
              }
            },
            "description": "Operator updated 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": "Update operator",
        "tags": ["Operators"]
      }
    },
    "/operators/{operatorId}/key-admin-account-ids": {
      "delete": {
        "description": "Users can remove key administrator role from associated operators",
        "operationId": "removeKeyAdminRole",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key admin role removed 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": "Remove key administrator role",
        "tags": ["Key administrator"]
      },
      "put": {
        "description": "Users can add key administrator role to associated operators.",
        "operationId": "addKeyAdminRole",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key admin role added 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": "Add key administrator role",
        "tags": ["Key administrator"]
      }
    },
    "/operators/{operatorId}/keycards": {
      "get": {
        "description": "Returns key cards that belong to the operator.",
        "operationId": "getOperatorKeyCards",
        "parameters": [
          {
            "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"
              }
            }
          },
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "content": [
                    {
                      "id": "999f6040-103f-11ee-be56-0242ac120002",
                      "type": "OTHER",
                      "code": "1234567890ABCDEF"
                    }
                  ],
                  "number": 0,
                  "numberOfElements": 1,
                  "size": 1,
                  "totalElements": 1,
                  "totalPages": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/PaginatedKeyCardRepresentation"
                }
              }
            },
            "description": "A list of key cards."
          },
          "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 key cards",
        "tags": ["Key Cards"]
      },
      "post": {
        "description": "Create new key card for the operator.",
        "operationId": "saveOperatorKeyCard",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveKeyCardRepresentation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "id": "999f6040-103f-11ee-be56-0242ac120002",
                  "type": "OTHER",
                  "code": "1234567890ABCDEF"
                },
                "schema": {
                  "$ref": "#/components/schemas/KeyCardRepresentation"
                }
              }
            },
            "description": "Newly created key card"
          },
          "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 new key card",
        "tags": ["Key Cards"]
      }
    },
    "/operators/{operatorId}/keycards/{keyCardId}": {
      "delete": {
        "description": "Deletes previously created key card.",
        "operationId": "deleteOperatorKeyCard",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "keyCardId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key card has been successfully deleted."
          },
          "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 key card",
        "tags": ["Key Cards"]
      }
    },
    "/operators/{operatorId}/keycards/{keyCardId}/primary": {
      "post": {
        "description": "Set a new primary key card for the operator. Operator can only have one primary key card.",
        "operationId": "setOperatorKeyCardAsPrimary",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "keyCardId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Key card has been successfully set as primary."
          },
          "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": "Set a key card as primary",
        "tags": ["Key Cards"]
      }
    },
    "/operators/{operatorId}/licenses": {
      "get": {
        "description": "Return licenses obtained by the operator.\nLicenses contain details like related qualifications and issued key cards.\n",
        "operationId": "getLicenses",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "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": {
              "application/json": {
                "example": {
                  "totalPages": 1,
                  "totalElements": 1,
                  "number": 0,
                  "size": 20,
                  "numberOfElements": 1,
                  "content": [
                    {
                      "identifier": "identifier",
                      "keyCards": [
                        {
                          "id": "11a3e6ed-441f-4fec-9263-d606679f23e4",
                          "type": "IPAF"
                        }
                      ],
                      "qualifications": [
                        {
                          "issuedDate": "2020-01-01T12:00:00Z",
                          "validToDate": "2040-01-01T12:00:00Z",
                          "reference": "reference",
                          "grade": "grade",
                          "category": {
                            "ipafSymbol": "GH",
                            "name": "Goods Hoist",
                            "description": "Goods Hoist"
                          }
                        }
                      ]
                    }
                  ]
                },
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PaginatedLicenseRepresentation"
                  }
                }
              }
            },
            "description": "Licenses returned 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 operator licenses",
        "tags": ["Licenses"]
      },
      "post": {
        "description": "The license must be unique within the account.\n",
        "operationId": "createLicense",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/LicenseRequestRepresentation"
                  },
                  {
                    "$ref": "#/components/schemas/IpafLicenseRequestRepresentation"
                  },
                  {
                    "$ref": "#/components/schemas/UnvalidatedLicenseRequestRepresentation"
                  },
                  {
                    "$ref": "#/components/schemas/UpdateUnvalidatedLicenseRequestRepresentation"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedLicenseRepresentation"
                }
              }
            },
            "description": "The license 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": "Add license to the operator",
        "tags": ["Licenses"]
      }
    },
    "/operators/{operatorId}/licenses/{licenseId}": {
      "delete": {
        "operationId": "deleteLicense",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "licenseId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The license 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 a license",
        "tags": ["Licenses"]
      },
      "patch": {
        "description": "Only unvalidated licenses can be updated\n",
        "operationId": "updateLicense",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "licenseId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUnvalidatedLicenseRequestRepresentation"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatedLicenseRepresentation"
                }
              }
            },
            "description": "The license updated 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": "Update existing operator's license",
        "tags": ["Licenses"]
      }
    },
    "/operators/{operatorId}/profile-image": {
      "delete": {
        "description": "Users can delete an account owned operators profile image\n",
        "operationId": "deleteProfileImage",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Image delete 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": "Delete profile image",
        "tags": ["Profile image"]
      },
      "post": {
        "description": "Users can upload a profile image to account owned operators profile.\n",
        "operationId": "uploadProfileImage",
        "parameters": [
          {
            "in": "path",
            "name": "operatorId",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": ["file"]
              }
            }
          }
        },
        "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 profile image",
        "tags": ["Profile image"]
      }
    }
  },
  "components": {
    "schemas": {
      "AccountOperatorRepresentation": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid",
            "description": "This is the id of the account that owns the operator."
          },
          "displayName": {
            "type": "string",
            "description": "The operator's full name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The operator's email."
          },
          "employeeNumber": {
            "type": "string",
            "description": "The operator's employee number."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "This is a unique id representing the operator."
          },
          "isKeyAdmin": {
            "type": "boolean",
            "description": "It's **true** if operator is a key administrator."
          },
          "operatorStatus": {
            "type": "string",
            "description": "This exposes the status of the relation to the account.\n\n|Type|Description|\n|-|-|\n|**INVITED**| Invitation has been sent to operator but it has not been accepted.|\n|**NOT_INVITED**|Operator has not been invited yet.|\n|**LINKED**| Operator has accepted an invite for this organization.|\n|**REJECTED**| Operator has rejected an invite for this organization.|\n|**OTHER**| Anything not matching the other types.|\n",
            "enum": ["INVITED", "NOT_INVITED", "REJECTED", "LINKED", "OTHER"]
          },
          "phone": {
            "type": "string",
            "description": "The operator's phone number."
          },
          "profileImageUrl": {
            "type": "string",
            "description": "The url to the image of the operators profile picture."
          }
        },
        "required": ["accountId", "id", "isKeyAdmin", "operatorStatus"]
      },
      "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"
            }
          }
        }
      },
      "CreateOperatorRepresentation": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "description": "The operator's full name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The operator's email."
          },
          "employeeNumber": {
            "type": "string",
            "description": "The operator's employee number."
          },
          "phone": {
            "type": "string",
            "description": "The operator's phone number."
          }
        }
      },
      "CreatedLicenseRepresentation": {
        "type": "object",
        "properties": {
          "license": {
            "description": "The details of created license.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LicenseRepresentation"
              },
              {
                "$ref": "#/components/schemas/IpafLicenseRepresentation"
              },
              {
                "$ref": "#/components/schemas/UnvalidatedLicenseRepresentation"
              }
            ]
          },
          "uploadUrl": {
            "type": "string",
            "description": "The upload link for the license file."
          }
        }
      },
      "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"
          }
        }
      },
      "IndependentOperatorRepresentation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OperatorRepresentation"
          },
          {
            "type": "object",
            "properties": {
              "linkedToAccountIds": {
                "type": "array",
                "description": "This is the ids of the accounts the operator is associated with.",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        ],
        "required": ["id", "keyAdminIds", "linkedToAccountIds"]
      },
      "Invitation": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid",
            "description": "This is the id of the account this invitation gives access to if accepted.",
            "minLength": 1
          },
          "accountName": {
            "type": "string",
            "description": "This is the name of the account the invitation is issued by."
          },
          "creatorEmail": {
            "type": "string",
            "description": "The email of the user who created the invitation."
          },
          "creatorName": {
            "type": "string",
            "description": "The name of the user who created the invitation."
          },
          "id": {
            "type": "string",
            "description": "This is an id representing the invitation. This identifier is used to reference this invitation across other APIs."
          },
          "operatorId": {
            "type": "string",
            "description": "This is the id of the invited operator."
          }
        },
        "required": ["accountId", "id"]
      },
      "InvitationRequest": {
        "type": "object",
        "properties": {
          "operatorId": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the operator that should be invited."
          }
        },
        "required": ["operatorId"]
      },
      "IpafLicenseRepresentation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LicenseRepresentation"
          },
          {
            "type": "object",
            "properties": {
              "keyCards": {
                "type": "array",
                "description": "The key cards attached to the license.",
                "items": {
                  "$ref": "#/components/schemas/KeyCardRepresentation"
                },
                "uniqueItems": true
              },
              "qualifications": {
                "type": "array",
                "description": "The qualifications provided by the license.",
                "items": {
                  "$ref": "#/components/schemas/QualificationRepresentation"
                },
                "uniqueItems": true
              }
            }
          }
        ],
        "required": ["id", "identifier", "keyCards", "qualifications", "type"]
      },
      "IpafLicenseRequestRepresentation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LicenseRequestRepresentation"
          },
          {
            "type": "object",
            "properties": {
              "dateOfBirth": {
                "type": "string",
                "format": "date"
              },
              "identifier": {
                "type": "string"
              }
            }
          }
        ],
        "description": "IPAF license of the operator to be added.",
        "required": ["identifier"]
      },
      "KeyCardRepresentation": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The code of the key card. Exposed only for non-IPAF key cards."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the key card."
          },
          "issuer": {
            "type": "string",
            "description": "The key card's issuer.",
            "enum": ["ACCOUNT", "OPERATOR"]
          },
          "name": {
            "type": "string",
            "description": "The name of the key card."
          },
          "type": {
            "type": "string",
            "description": "The type of the key card.",
            "enum": ["OTHER", "IPAF"]
          }
        },
        "required": ["id", "issuer", "type"]
      },
      "LicenseRepresentation": {
        "type": "object",
        "discriminator": {
          "mapping": {
            "IPAF": "#/components/schemas/IpafLicenseRepresentation",
            "UNVALIDATED": "#/components/schemas/UnvalidatedLicenseRepresentation"
          },
          "propertyName": "type"
        },
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "License identifier in the system"
          },
          "identifier": {
            "type": "string",
            "description": "License identifier, eg. for ipaf: OP/123456."
          },
          "type": {
            "type": "string"
          }
        },
        "required": ["id", "identifier", "type"]
      },
      "LicenseRequestRepresentation": {
        "type": "object",
        "discriminator": {
          "mapping": {
            "IPAF": "#/components/schemas/IpafLicenseRequestRepresentation",
            "UNVALIDATED": "#/components/schemas/UnvalidatedLicenseRequestRepresentation",
            "UPDATE_UNVALIDATED": "#/components/schemas/UpdateUnvalidatedLicenseRequestRepresentation"
          },
          "propertyName": "type"
        },
        "properties": {
          "type": {
            "type": "string",
            "enum": ["IPAF", "UNVALIDATED", "UPDATE_UNVALIDATED"]
          }
        }
      },
      "OperatorRepresentation": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "description": "The operator's full name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "The operator's email."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "This is a unique id representing the operator."
          },
          "keyAdminIds": {
            "type": "array",
            "description": "This is the ids of the accounts the operator is a key administrator for.",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "phone": {
            "type": "string",
            "description": "The operator's phone number."
          },
          "profileImageUrl": {
            "type": "string",
            "description": "The url to the image of the operators profile picture."
          }
        },
        "required": ["id", "keyAdminIds"]
      },
      "PaginatedCursorOperatorRepresentation": {
        "type": "object",
        "properties": {
          "after": {
            "type": "string",
            "description": "Specifies the pagination cursor for the next page of returned items."
          },
          "content": {
            "type": "array",
            "description": "The page content as a list.",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/AccountOperatorRepresentation"
                },
                {
                  "$ref": "#/components/schemas/IndependentOperatorRepresentation"
                }
              ]
            }
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "Specifies the number of results returned (maximum 200)."
          }
        }
      },
      "PaginatedKeyCardRepresentation": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "description": "The page content as a list.",
            "items": {
              "$ref": "#/components/schemas/KeyCardRepresentation"
            }
          },
          "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."
          }
        }
      },
      "PaginatedLicenseRepresentation": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "description": "The page content as a list.",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/LicenseRepresentation"
                },
                {
                  "$ref": "#/components/schemas/IpafLicenseRepresentation"
                },
                {
                  "$ref": "#/components/schemas/UnvalidatedLicenseRepresentation"
                }
              ]
            }
          },
          "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."
          }
        }
      },
      "PartlyUpdateOperatorRepresentation": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "description": "The operator's full name."
          },
          "email": {
            "type": "string",
            "description": "The operator's email."
          },
          "employeeNumber": {
            "type": "string",
            "description": "The operator's employee number."
          },
          "firstName": {
            "type": "string",
            "deprecated": true,
            "description": "The operator's first name. **displayName** should be used instead."
          },
          "lastName": {
            "type": "string",
            "deprecated": true,
            "description": "The operator's last name. **displayName** should be used instead."
          },
          "password": {
            "type": "string",
            "description": "Set a new password for the operator."
          },
          "phone": {
            "type": "string",
            "description": "The operator's phone number."
          }
        }
      },
      "QualificationCategoryRepresentation": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Description of the qualification. Can come from IPAF definition."
          },
          "ipafSymbol": {
            "type": "string",
            "description": "If the qualification is defined in IPAF, the symbol will be populated."
          },
          "name": {
            "type": "string",
            "description": "Name of the qualification. Can come from IPAF definition."
          }
        }
      },
      "QualificationRepresentation": {
        "type": "object",
        "properties": {
          "category": {
            "$ref": "#/components/schemas/QualificationCategoryRepresentation",
            "description": "Which machine category the qualification is for."
          },
          "grade": {
            "type": "string",
            "description": "The grade value."
          },
          "issuedDate": {
            "type": "string",
            "format": "date-time",
            "description": "The issue date of the qualification."
          },
          "reference": {
            "type": "string",
            "description": "The reference value."
          },
          "validToDate": {
            "type": "string",
            "format": "date-time",
            "description": "Until when the qualification is valid."
          }
        }
      },
      "SaveKeyCardRepresentation": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The code of the key card.",
            "maxLength": 16,
            "maximum": 16,
            "minLength": 0,
            "pattern": "^[0-9a-fA-F]+$"
          },
          "name": {
            "type": "string",
            "description": "The name of the key card.",
            "minLength": 1
          },
          "type": {
            "type": "string",
            "description": "The type of the key card. Only OTHER currently supported.",
            "enum": ["OTHER", "IPAF"]
          }
        },
        "required": ["code", "name", "type"]
      },
      "UnvalidatedLicenseRepresentation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LicenseRepresentation"
          },
          {
            "type": "object",
            "properties": {
              "addedByUserId": {
                "type": "string",
                "format": "uuid"
              },
              "addedDate": {
                "type": "string",
                "format": "date-time"
              },
              "expiryDate": {
                "type": "string",
                "format": "date-time"
              },
              "fileDownloadUrl": {
                "type": "string",
                "format": "url"
              },
              "fileId": {
                "type": "string",
                "format": "uuid"
              },
              "fileName": {
                "type": "string"
              },
              "fileStatus": {
                "type": "string",
                "enum": ["PENDING_UPLOAD", "UPLOADED"]
              },
              "issuedBy": {
                "type": "string"
              },
              "issuedDate": {
                "type": "string",
                "format": "date-time"
              },
              "thumbnailDownloadUrl": {
                "type": "string",
                "format": "url"
              },
              "thumbnailId": {
                "type": "string",
                "format": "uuid"
              },
              "title": {
                "type": "string"
              }
            }
          }
        ],
        "required": ["id", "identifier", "type"]
      },
      "UnvalidatedLicenseRequestRepresentation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LicenseRequestRepresentation"
          },
          {
            "type": "object",
            "properties": {
              "expiryDate": {
                "type": "string",
                "format": "date-time"
              },
              "identifier": {
                "type": "string"
              },
              "isFile": {
                "type": "boolean"
              },
              "issuedBy": {
                "type": "string"
              },
              "issuedDate": {
                "type": "string",
                "format": "date-time"
              },
              "title": {
                "type": "string"
              }
            }
          }
        ],
        "description": "Unvalidated license of the operator to be added.",
        "required": ["identifier", "title"]
      },
      "UpdateUnvalidatedLicenseRequestRepresentation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LicenseRequestRepresentation"
          },
          {
            "type": "object",
            "properties": {
              "expiryDate": {
                "type": "string",
                "format": "date-time"
              },
              "fileOperation": {
                "type": "string",
                "enum": ["UPDATE", "REMOVE"]
              },
              "identifier": {
                "type": "string"
              },
              "issuedBy": {
                "type": "string"
              },
              "issuedDate": {
                "type": "string",
                "format": "date-time"
              },
              "title": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        ],
        "description": "Unvalidated license of the operator to be updated.",
        "required": ["title"]
      },
      "UpdatedLicenseRepresentation": {
        "type": "object",
        "properties": {
          "license": {
            "description": "The details of update license.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LicenseRepresentation"
              },
              {
                "$ref": "#/components/schemas/IpafLicenseRepresentation"
              },
              {
                "$ref": "#/components/schemas/UnvalidatedLicenseRepresentation"
              }
            ]
          },
          "uploadUrl": {
            "type": "string",
            "description": "The upload link for the license file."
          }
        }
      },
      "Violation": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "authorizationBearer": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
