{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-kubernetes-service/json-schema/microsoft-azure-kubernetes-service-gate-schema.json",
  "title": "Gate",
  "description": "A Gate controls the progression during a staged rollout, e.g. in an Update Run.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-kubernetes-service-gates-api-openapi.yml#/components/schemas/Gate",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/GateProperties",
      "description": "The resource-specific properties for this resource.",
      "x-ms-client-flatten": true
    },
    "eTag": {
      "type": "string",
      "description": "If eTag is provided in the response body, it may also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.",
      "readOnly": true
    }
  },
  "allOf": [
    {
      "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource"
    }
  ],
  "$defs": {
    "DayOfWeek": {
      "type": "string",
      "description": "The days of a week.",
      "enum": [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"
      ],
      "x-ms-enum": {
        "name": "DayOfWeek",
        "modelAsString": true,
        "values": [
          {
            "name": "Monday",
            "value": "Monday",
            "description": "The day Monday."
          },
          {
            "name": "Tuesday",
            "value": "Tuesday",
            "description": "The day Tuesday."
          },
          {
            "name": "Wednesday",
            "value": "Wednesday",
            "description": "The day Wednesday."
          },
          {
            "name": "Thursday",
            "value": "Thursday",
            "description": "The day Thursday."
          },
          {
            "name": "Friday",
            "value": "Friday",
            "description": "The day Friday."
          },
          {
            "name": "Saturday",
            "value": "Saturday",
            "description": "The day Saturday."
          },
          {
            "name": "Sunday",
            "value": "Sunday",
            "description": "The day Sunday."
          }
        ]
      }
    },
    "GateProperties": {
      "type": "object",
      "description": "A Gate controls the progression during a staged rollout, e.g. in an Update Run.",
      "properties": {
        "provisioningState": {
          "$ref": "#/$defs/GateProvisioningState",
          "description": "The provisioning state of the Gate resource.",
          "readOnly": true
        },
        "displayName": {
          "type": "string",
          "description": "The human-readable display name of the Gate.",
          "minLength": 1,
          "maxLength": 100,
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "gateType": {
          "$ref": "#/$defs/GateType",
          "description": "The type of the Gate determines how it is completed.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "scheduledStartProperties": {
          "$ref": "#/$defs/ScheduledStartProperties",
          "description": "Details for ScheduledStart gate",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "target": {
          "$ref": "#/$defs/GateTarget",
          "description": "The target that the Gate is controlling, e.g. an Update Run.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "state": {
          "$ref": "#/$defs/GateState",
          "description": "The state of the Gate.",
          "x-ms-mutability": [
            "read",
            "update",
            "create"
          ]
        }
      },
      "required": [
        "gateType",
        "target",
        "state"
      ]
    },
    "GateProvisioningState": {
      "type": "string",
      "description": "The provisioning state of the Gate resource.",
      "enum": [
        "Succeeded",
        "Failed",
        "Canceled"
      ],
      "x-ms-enum": {
        "name": "GateProvisioningState",
        "modelAsString": true,
        "values": [
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "Resource has been created."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Resource creation failed."
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "Resource creation was canceled."
          }
        ]
      },
      "readOnly": true
    },
    "GateState": {
      "type": "string",
      "description": "The state of the Gate.",
      "enum": [
        "Pending",
        "Skipped",
        "Completed"
      ],
      "x-ms-enum": {
        "name": "GateState",
        "modelAsString": true,
        "values": [
          {
            "name": "Pending",
            "value": "Pending",
            "description": "A Pending Gate will continue to block the staged rollout process it is controlling."
          },
          {
            "name": "Skipped",
            "value": "Skipped",
            "description": "A Skipped Gate means that the staged rollout process it is controlling was skipped."
          },
          {
            "name": "Completed",
            "value": "Completed",
            "description": "An Completed Gate allows the staged rollout process to continue."
          }
        ]
      }
    },
    "GateTarget": {
      "type": "object",
      "description": "The target that the Gate is controlling, e.g. an Update Run. Exactly one of the properties objects will be set.",
      "properties": {
        "id": {
          "$ref": "#/$defs/UpdateRunResourceId",
          "description": "The resource id that the Gate is controlling the rollout of.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "updateRunProperties": {
          "$ref": "#/$defs/UpdateRunGateTargetProperties",
          "description": "The properties of the Update Run that the Gate is targeting.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "id"
      ]
    },
    "GateType": {
      "type": "string",
      "description": "The type of the Gate determines how it is completed.",
      "enum": [
        "Approval",
        "ScheduledStart"
      ],
      "x-ms-enum": {
        "name": "GateType",
        "modelAsString": true,
        "values": [
          {
            "name": "Approval",
            "value": "Approval",
            "description": "An approval gate is completed by setting its state to be Completed."
          },
          {
            "name": "ScheduledStart",
            "value": "ScheduledStart",
            "description": "A scheduled start gate is automatically completed when the scheduled time is reached."
          }
        ]
      }
    },
    "ScheduledStartProperties": {
      "type": "object",
      "description": "Properties for ScheduledStart gate",
      "properties": {
        "startDay": {
          "$ref": "#/$defs/DayOfWeek",
          "description": "The day of the week when the scheduled start occurs.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "startTime": {
          "type": "string",
          "description": "The local time of day when the scheduled start occurs in 24-hour (HH:mm) format.",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "utcOffset": {
          "type": "string",
          "description": "The UTC offset for the scheduled time in HH:mm format, -14:00 to +14:00",
          "pattern": "^[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00)$",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        },
        "absoluteStartTime": {
          "type": "string",
          "format": "date-time",
          "description": "The absolute UTC time when the gate will complete. Set when the gate is created.",
          "readOnly": true
        }
      },
      "required": [
        "startDay",
        "startTime",
        "utcOffset"
      ]
    },
    "Timing": {
      "type": "string",
      "description": "Whether the Gate is placed before or after the target.",
      "enum": [
        "Before",
        "After"
      ],
      "x-ms-enum": {
        "name": "Timing",
        "modelAsString": true,
        "values": [
          {
            "name": "Before",
            "value": "Before",
            "description": "The Gate is before the target."
          },
          {
            "name": "After",
            "value": "After",
            "description": "The Gate is after the target."
          }
        ]
      }
    },
    "UpdateRunGateTargetProperties": {
      "type": "object",
      "description": "The properties of the Update Run that the Gate is targeting.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the Update Run.",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
          "readOnly": true
        },
        "stage": {
          "type": "string",
          "description": "The Update Stage of the Update Run.",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
          "readOnly": true
        },
        "group": {
          "type": "string",
          "description": "The Update Group of the Update Run.",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
          "readOnly": true
        },
        "timing": {
          "$ref": "#/$defs/Timing",
          "description": "Whether the Gate is placed before or after the update itself.",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "name",
        "timing"
      ]
    },
    "UpdateRunResourceId": {
      "type": "string",
      "format": "arm-id",
      "description": "A type definition that refers the id to an Azure Resource Manager resource.",
      "x-ms-arm-id-details": {
        "allowedResources": [
          {
            "type": "Microsoft.ContainerService/fleets/updateRuns"
          }
        ]
      }
    }
  }
}