{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/acronis/main/json-schema/acronis-agent-update-settings-in-schema.json",
  "title": "AgentUpdateSettingsIn",
  "description": "Unattended agent update settings to be stored by Agent Manager. The settings can be assigned either to a particular agent instance or to a tenant. In the latter case they are called master settings and apply to every agent that belongs to the tenant and does not have its own settings assigned. Master settings also recursively apply to tenants down tenant hierarchy until a tenant with its own master settings or visibility barrier set is encountered.",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/acronis-agents-v2-openapi.json#/components/schemas/AgentUpdateSettingsIn",
  "type": "object",
  "required": [
    "automatic",
    "update_channel"
  ],
  "properties": {
    "agent_id": {
      "description": "ID of a registered agent the settings belong to. This must only be present if tenant ID is absent.",
      "type": "string"
    },
    "automatic": {
      "description": "Boolean flag specifying whether agent should be automatically updated to the latest version available in its update channel.",
      "default": false,
      "type": "boolean"
    },
    "maintenance_window": {
      "description": "Time intervals when agent update is allowed. If the window is not specified, this means that agent can be updated at any time. The window should be ignored if automatic update is disabled.",
      "type": "object",
      "required": [
        "time_from",
        "days_of_week",
        "time_to"
      ],
      "properties": {
        "time_from": {
          "description": "Time of day when agent maintenance may start. It is agent local time.",
          "type": "string",
          "pattern": "^(?:[0-1][0-9]|2[0-3])(?::[0-5][0-9]){2}$",
          "minLength": 8,
          "maxLength": 8
        },
        "days_of_week": {
          "description": "Days of week when agent maintenance may start (window's start time belongs to these days). They can be given in any order but duplicates are not allowed.",
          "type": "array",
          "maxItems": 7,
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/DayOfWeek"
          }
        },
        "time_to": {
          "description": "Time of day agent maintenance must complete before. It is agent local time. If this time is less than or equal to maintenance start time, this means the maintenance may proceed until this time next day.",
          "type": "string",
          "pattern": "^(?:[0-1][0-9]|2[0-3])(?::[0-5][0-9]){2}$",
          "minLength": 8,
          "maxLength": 8
        }
      }
    },
    "update_channel": {
      "$ref": "#/$defs/AgentUpdateChannel"
    },
    "tenant_id": {
      "description": "ID of a tenant the settings belong to. This must only be present if agent ID is absent. It is possible to omit both identifiers, in which case value from `X-Apigw-Tenant-Id` request header is used. If the header is also absent, root of tenant hierarchy as it is seen to Agent Manager (according to properties of its service account) is used.",
      "type": "string"
    }
  },
  "$defs": {
    "AgentUpdateChannel": {
      "description": "Source of new agent versions.",
      "enum": [
        "CURRENT",
        "STABLE"
      ],
      "type": "string"
    },
    "DayOfWeek": {
      "description": "Day of week specifier.",
      "enum": [
        "MONDAY",
        "TUESDAY",
        "WEDNESDAY",
        "THURSDAY",
        "FRIDAY",
        "SATURDAY",
        "SUNDAY"
      ],
      "type": "string"
    }
  }
}