{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "title": "DocumentDisplaysResponse",
  "description": "DocumentDisplaysResponse PI_JSON",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "documentDisplays": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/definitions/DocumentDisplayReport"
          },
          {
            "$ref": "#/definitions/DocumentDisplayBrowser"
          },
          {
            "$ref": "#/definitions/DocumentDisplayCompose"
          }
        ]
      }
    },
    "workflows": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/DocumentDisplayWorkflow"
      },
      "description": "List of workflows associated with the document displays"
    }
  },
  "definitions": {
    "DocumentDisplayReport": {
      "type": "object",
      "required": [
        "id",
        "name",
        "report"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "the id of the document display"
        },
        "name": {
          "type": "string",
          "description": "the name of the document display"
        },
        "editPermissions": {
          "type": "boolean",
          "description": "Indicates whether the user has edit permissions for the document display"
        },
        "relativeViewPeriod": {
          "$ref": "#/definitions/RelativeViewPeriod"
        },
        "type": {
          "type": "string",
          "description": "the type the document display"
        },
        "report": {
          "$ref": "#/definitions/DocumentDisplayReportType"
        }
      }
    },
    "DocumentDisplayReportType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "reportModuleInstanceId": {
          "type": "string",
          "description": "the id of the report module instance"
        },
        "archiveProduct": {
          "$ref": "#/definitions/DocumentDisplayArchiveProduct"
        },
        "showReports": {
          "$ref": "#/definitions/DocumentDisplayShowReports"
        },
        "editor": {
          "type": "boolean",
          "description": "Indicates whether the user can edit the report"
        }
      }
    },
    "DocumentDisplayShowReports": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "productWorkflowStatusIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of product workflow status IDs to show in the report"
        }
      }
    },
    "DocumentDisplayCompose": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "the id of the document display"
        },
        "name": {
          "type": "string",
          "description": "the name of the document display"
        },
        "editPermissions": {
          "type": "boolean",
          "description": "Indicates whether the user has edit permissions for the document display"
        },
        "type": {
          "type": "string",
          "description": "the type the document display"
        },
        "relativeViewPeriod": {
          "$ref": "#/definitions/RelativeViewPeriod"
        },
        "compose": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProductAndTemplate"
          }
        }
      }
    },
    "ProductAndTemplate": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "archiveProduct": {
          "$ref": "#/definitions/DocumentDisplayArchiveProduct"
        },
        "template": {
          "$ref": "#/definitions/DocumentDisplayArchiveProduct"
        }
      }
    },
    "DocumentDisplayBrowser": {
      "type": "object",
      "required": [
        "id",
        "name",
        "browser"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "the id of the document display"
        },
        "name": {
          "type": "string",
          "description": "the name of the document display"
        },
        "editPermissions": {
          "type": "boolean",
          "description": "Indicates whether the user has edit permissions for the document display"
        },
        "type": {
          "type": "string",
          "description": "the type the document display"
        },
        "relativeViewPeriod": {
          "$ref": "#/definitions/RelativeViewPeriod"
        },
        "browser": {
          "$ref": "#/definitions/DocumentDisplayBrowserType"
        }
      }
    },
    "DocumentComposeType": {
      "type": "object",
        "additionalProperties": false,
        "properties": {
            "browser": {
            "$ref": "#/definitions/DocumentDisplayBrowserType"
            }
        }
    },
    "DocumentDisplayBrowserType": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "layout": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "preview": {
              "type": "boolean"
            },
            "headers": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "productProperty": {
                    "type": "string"
                  },
                  "productAttribute": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "archiveProducts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentDisplayArchiveProduct"
          }
        },
        "archiveProductSets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentDisplayArchiveProductSet"
          }
        }
      }
    },
    "DocumentDisplayArchiveProduct": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "areaId": {
          "type": "string"
        },
        "sourceId": {
          "type": "string"
        },
        "versionKeys": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "attributes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentDisplayArchiveProductAttribute"
          }
        }
      }
    },
    "DocumentDisplayArchiveProductSet": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "constraints": {
          "$ref": "#/definitions/ArchiveProductSetConstraints"
        }
      }
    },
    "ArchiveProductSetConstraints": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "areaId": {
          "type": "string"
        },
        "sourceId": {
          "type": "string"
        },
        "allValid": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ArchiveProductSetConstraintsAttributeTextEquals"
          }
        },
        "anyValid": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ArchiveProductSetConstraintsAttributeTextEquals"
          }
        }
      }
    },
    "ArchiveProductSetConstraintsAttributeTextEquals": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "attributeTextEquals": {
          "$ref": "#/definitions/ArchiveProductSetConstraintsAttributeEquals"
        }
      }
    },
    "ArchiveProductSetConstraintsAttributeEquals": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "equals": {
          "type": "string"
        }
      }
    },
    "DocumentDisplayArchiveProductAttribute": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "key": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "RelativeViewPeriod": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "unit": {
          "type": "string"
        },
        "start": {
          "type": "string",
          "format": "integer"
        },
        "end": {
          "type": "string",
          "format": "integer"
        }
      },
      "required": [
        "end",
        "start",
        "unit"
      ],
      "title": "RelativeViewPeriod"
    },
    "DocumentDisplayWorkflow": {
      "type": "object",
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "the id of the workflow"
        },
        "statuses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentDisplayWorkflowStatus"
          },
          "description": "List of workflow status IDs"
        },
        "transitions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DocumentDisplayWorkflowTransition"
          },
          "description": "List of workflow transition IDs"
        }
      }
    },
    "DocumentDisplayWorkflowStatus": {
      "type": "object",
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "the id of the status"
        },
        "name": {
          "type": "string",
          "description": "the name of the status"
        },
        "attribute": {
          "$ref": "#/definitions/DocumentDisplayWorkflowStatusAttribute"
        }
      }
    },
    "DocumentDisplayWorkflowStatusAttribute": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "additionalProperties": false,
      "properties": {
        "key": {
          "type": "string",
          "description": "the key of the workflow status attribute"
        },
        "value": {
          "type": "string",
          "description": "the value of the workflow status attribute"
        }
      }
    },
    "DocumentDisplayWorkflowTransition": {
      "type": "object",
      "required": [
        "fromStatus",
        "toStatus"
      ],
      "additionalProperties": false,
      "properties": {
        "fromStatus": {
          "type": "string",
          "description": "the form status of the transition"
        },
        "toStatus": {
          "type": "string",
          "description": "the form status of the transition"
        },
        "editPermissions": {
          "type": "boolean",
          "description": "Indicates whether the user has edit permissions for the transition"
        }
      }
    }
  }
}
