{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "title": "localize_entity_command",
  "description": "Localize entity command schema.",
  "additionalProperties": false,
  "required": [
    "service_id",
    "entity_type",
    "entity_id",
    "localizations"
  ],
  "properties": {
    "service_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "^$|.*\\S.*",
      "description": "The string has a minimum length of one character and it cannot consist of only whitespace characters."
    },
    "entity_type": {
      "type": "string",
      "minLength": 1,
      "pattern": "^$|.*\\S.*",
      "description": "The string has a minimum length of one character and it cannot consist of only whitespace characters."
    },
    "entity_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "^$|.*\\S.*",
      "description": "The string has a minimum length of one character and it cannot consist of only whitespace characters."
    },
    "localizations": {
      "type": "array",
      "description": "An array of localizations for multiple locales.",
      "additionalItems": false,
      "minItems": 1,
      "items": {
        "type": "object",
        "title": "entity_localization",
        "description": "The localization for a single locale.",
        "additionalProperties": false,
        "required": [
          "language_tag",
          "fields"
        ],
        "properties": {
          "language_tag": {
            "type": "string",
            "description": "The language code of the locale."
          },
          "fields": {
            "type": "array",
            "description": "An array of objects containing fields data for specific locales.",
            "additionalItems": false,
            "items": {
              "type": "object",
              "title": "entity_localization_field",
              "description": "Field that will be set for the localized entity.",
              "additionalProperties": false,
              "required": [
                "field_name"
              ],
              "properties": {
                "field_name": {
                  "type": "string",
                  "description": "The name of a localized field for a specific locale."
                },
                "field_value": {
                  "type": "string",
                  "description": "The value of a localized field for a specific locale."
                },
                "state": {
                  "type": "string",
                  "title": "entity_localization_field_state",
                  "enum": [
                    "UNTRANSLATED",
                    "REVIEW_PENDING",
                    "APPROVED",
                    "REJECTED"
                  ],
                  "description": "The state of a localized field for a specific locale."
                }
              }
            }
          }
        }
      }
    }
  }
}