{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "outputPort",
  "type": "object",
  "title": "Output port",
  "description": "Output port defines the way data is consumed from the data product.",
  "properties": {
    "subscriptionChannels": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "channelType": {
                "type": "string",
                "enum": [
                  "JDBC"
                ]
              },
              "queryType": {
                "type": "string",
                "enum": [
                  "SQL"
                ]
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "channelType": {
                "type": "string",
                "enum": [
                  "REST-API"
                ]
              },
              "queryType": {
                "type": "string",
                "enum": [
                  "SQL",
                  "GREMLIN",
                  "OLAP"
                ]
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "channelType": {
                "type": "string",
                "enum": [
                  "GRAPHQL"
                ]
              },
              "queryType": {
                "type": "string",
                "enum": [
                  "GRAPHQL"
                ]
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "channelType": {
                "type": "string",
                "enum": [
                  "Postgres"
                ]
              },
              "queryType": {
                "type": "string",
                "enum": [
                  "SQL"
                ]
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "channelType": {
                "type": "string",
                "enum": [
                  "Dataproduct"
                ]
              },
              "queryType": {
                "type": "string",
                "enum": [
                  "SQL"
                ]
              }
            }
          }
        ]
      },
      "minItems": 1
    },
    "updateChannels": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "s3-csv",
                  "s3-parquet",
                  "s3-json",
                  "vertica-table",
                  "postgres-table"
                ]
              },
              "syncType": {
                "type": "string",
                "enum": [
                  "push"
                ],
                "description": "The data will be pushed to the configured dataSet"
              },
              "dataSetUrn": {
                "type": "string",
                "description": "",
                "pattern": "^(?:urn|URN):(?:dv|DV):dataset:[A-Za-z0-9\\-]+$"
              }
            },
            "required": [
              "type",
              "dataSetUrn"
            ]
          }
        ]
      },
      "minItems": 1
    }
  },
  "required": [
    "subscriptionChannels"
  ]
}
