{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-failover-group-update-schema.json",
  "title": "FailoverGroupUpdate",
  "description": "A failover group update request.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-failovergroups-api-openapi.yml#/components/schemas/FailoverGroupUpdate",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/FailoverGroupUpdateProperties"
    },
    "tags": {
      "type": "object",
      "description": "Resource tags.",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "FailoverGroupReadOnlyEndpoint": {
      "type": "object",
      "description": "Read-only endpoint of the failover group instance.",
      "properties": {
        "failoverPolicy": {
          "type": "string",
          "description": "Failover policy of the read-only endpoint for the failover group.",
          "enum": [
            "Disabled",
            "Enabled"
          ],
          "x-ms-enum": {
            "name": "ReadOnlyEndpointFailoverPolicy",
            "modelAsString": true,
            "values": [
              {
                "name": "Disabled",
                "value": "Disabled",
                "description": "Disabled"
              },
              {
                "name": "Enabled",
                "value": "Enabled",
                "description": "Enabled"
              }
            ]
          }
        },
        "targetServer": {
          "type": "string",
          "format": "arm-id",
          "description": "The target partner server where the read-only endpoint points to.",
          "x-ms-arm-id-details": {
            "allowedResources": [
              {
                "type": "Microsoft.Sql/servers"
              }
            ]
          }
        }
      }
    },
    "FailoverGroupReadWriteEndpoint": {
      "type": "object",
      "description": "Read-write endpoint of the failover group instance.",
      "properties": {
        "failoverPolicy": {
          "type": "string",
          "description": "Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.",
          "enum": [
            "Manual",
            "Automatic"
          ],
          "x-ms-enum": {
            "name": "ReadWriteEndpointFailoverPolicy",
            "modelAsString": true,
            "values": [
              {
                "name": "Manual",
                "value": "Manual",
                "description": "Manual"
              },
              {
                "name": "Automatic",
                "value": "Automatic",
                "description": "Automatic"
              }
            ]
          }
        },
        "failoverWithDataLossGracePeriodMinutes": {
          "type": "integer",
          "format": "int32",
          "description": "Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required."
        }
      },
      "required": [
        "failoverPolicy"
      ]
    },
    "FailoverGroupUpdateProperties": {
      "type": "object",
      "description": "Properties of a failover group update.",
      "properties": {
        "readWriteEndpoint": {
          "$ref": "#/$defs/FailoverGroupReadWriteEndpoint"
        },
        "readOnlyEndpoint": {
          "$ref": "#/$defs/FailoverGroupReadOnlyEndpoint"
        },
        "databases": {
          "type": "array",
          "description": "List of databases in the failover group.",
          "items": {
            "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.Sql/servers/databases"
                }
              ]
            }
          }
        },
        "partnerServers": {
          "type": "array",
          "description": "List of partner server information for the failover group.",
          "items": {
            "$ref": "#/$defs/PartnerInfo"
          }
        },
        "secondaryType": {
          "$ref": "#/$defs/secondaryType"
        }
      }
    },
    "PartnerInfo": {
      "type": "object",
      "description": "Partner server information for the failover group.",
      "properties": {
        "id": {
          "type": "string",
          "format": "arm-id",
          "description": "Resource identifier of the partner server.",
          "x-ms-arm-id-details": {
            "allowedResources": [
              {
                "type": "Microsoft.Sql/servers"
              }
            ]
          }
        },
        "location": {
          "type": "string",
          "description": "Geo location of the partner server.",
          "readOnly": true
        },
        "replicationRole": {
          "$ref": "#/$defs/replicationRole"
        }
      },
      "required": [
        "id"
      ]
    }
  }
}