{
  "additionalProperties": false,
  "else": {
    "not": {
      "required": [
        "connectorRef"
      ]
    }
  },
  "if": {
    "properties": {
      "destination": {
        "const": "connector"
      }
    },
    "required": [
      "destination"
    ]
  },
  "properties": {
    "connectionFolder": {
      "maxLength": 200,
      "type": "string",
      "x-lumen-description": {
        "en": "Under the connection's folder; empty saves there. A file with the same name is saved as its new version, and SharePoint keeps the old versions.",
        "he": "מתחת לתיקייה של החיבור; ריק שומר בה. קובץ באותו שם נשמר כגרסה חדשה שלו, ו-SharePoint שומר את הגרסאות הקודמות."
      },
      "x-lumen-show-when": {
        "key": "destination",
        "value": "connector"
      },
      "x-lumen-title": {
        "en": "Folder in the connection",
        "he": "תיקייה בחיבור"
      },
      "x-lumen-widget": "field-picker"
    },
    "connectorRef": {
      "minLength": 1,
      "type": "string",
      "x-lumen-widget": "connector-ref"
    },
    "destination": {
      "default": "lumen",
      "enum": [
        "lumen",
        "connector"
      ],
      "type": "string",
      "x-lumen-widget": "segmented"
    },
    "folder": {
      "maxLength": 200,
      "type": "string",
      "x-lumen-description": {
        "en": "Use / for subfolders, {flow} for the flow's name and {date:yyyy-MM} for the month. Empty saves to Saved/{flow}. A file whose name is taken is saved as name (2).",
        "he": "/ יוצר תת תיקיות, {flow} הוא שם התהליך ו {date:yyyy-MM} הוא החודש. ריק שומר אל Saved/{flow}. קובץ ששמו תפוס נשמר בשם (2)."
      },
      "x-lumen-show-when": {
        "key": "destination",
        "value": "lumen"
      },
      "x-lumen-title": {
        "en": "Folder in Files",
        "he": "תיקייה בקבצים"
      },
      "x-lumen-widget": "field-picker"
    },
    "ifExists": {
      "default": "copy",
      "enum": [
        "copy",
        "replace"
      ],
      "type": "string",
      "x-lumen-description": {
        "en": "Keep both saves the new file as name (2). Replace saves it under the same name and keeps the previous file in .versions.",
        "he": "לשמור את שניהם שומר את הקובץ החדש בשם (2). להחליף שומר אותו באותו שם ומשאיר את הקובץ הקודם ב-.versions."
      },
      "x-lumen-options": {
        "copy": {
          "en": "Keep both",
          "he": "לשמור את שניהם"
        },
        "replace": {
          "en": "Replace",
          "he": "להחליף"
        }
      },
      "x-lumen-show-when": {
        "key": "destination",
        "value": "lumen"
      },
      "x-lumen-title": {
        "en": "If the name is taken",
        "he": "אם השם תפוס"
      },
      "x-lumen-widget": "segmented"
    }
  },
  "then": {
    "required": [
      "connectorRef"
    ]
  },
  "type": "object"
}
