{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-backup/json-schema/microsoft-azure-backup-patch-resource-request-input-schema.json",
  "title": "PatchResourceRequestInput",
  "description": "Patch Request content for Microsoft.DataProtection resources",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-backup-backupvaultresources-api-openapi.yml#/components/schemas/PatchResourceRequestInput",
  "type": "object",
  "properties": {
    "identity": {
      "$ref": "#/$defs/DppIdentityDetails",
      "description": "Input Managed Identity Details"
    },
    "properties": {
      "$ref": "#/$defs/PatchBackupVaultInput",
      "description": "Resource properties."
    },
    "tags": {
      "type": "object",
      "description": "Resource tags.",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "AlertsState": {
      "type": "string",
      "enum": [
        "Enabled",
        "Disabled"
      ],
      "x-ms-enum": {
        "name": "AlertsState",
        "modelAsString": true,
        "values": [
          {
            "name": "Enabled",
            "value": "Enabled"
          },
          {
            "name": "Disabled",
            "value": "Disabled"
          }
        ]
      }
    },
    "AzureMonitorAlertSettings": {
      "type": "object",
      "description": "Settings for Azure Monitor based alerts",
      "properties": {
        "alertsForAllJobFailures": {
          "$ref": "#/$defs/AlertsState"
        }
      }
    },
    "CmkKekIdentity": {
      "type": "object",
      "description": "The details of the managed identity used for CMK",
      "properties": {
        "identityType": {
          "$ref": "#/$defs/IdentityType",
          "description": "The identity type. 'SystemAssigned' and 'UserAssigned' are mutually exclusive. 'SystemAssigned' will use implicitly created managed identity."
        },
        "identityId": {
          "type": "string",
          "description": "The managed identity to be used which has access permissions to the Key Vault. Provide a value here in case identity types: 'UserAssigned' only."
        }
      }
    },
    "CmkKeyVaultProperties": {
      "type": "object",
      "description": "The properties of the Key Vault which hosts CMK",
      "properties": {
        "keyUri": {
          "type": "string",
          "description": "The key uri of the Customer Managed Key"
        }
      }
    },
    "CostManagementSettings": {
      "type": "object",
      "description": "Cost Management Settings of the vault",
      "properties": {
        "granularityLevel": {
          "$ref": "#/$defs/GranularityLevel",
          "description": "Settings for granularity level"
        }
      }
    },
    "CrossRegionRestoreSettings": {
      "type": "object",
      "properties": {
        "state": {
          "$ref": "#/$defs/CrossRegionRestoreState",
          "description": "CrossRegionRestore state"
        }
      }
    },
    "CrossRegionRestoreState": {
      "type": "string",
      "description": "CrossRegionRestore state",
      "enum": [
        "Disabled",
        "Enabled"
      ],
      "x-ms-enum": {
        "name": "CrossRegionRestoreState",
        "modelAsString": true,
        "values": [
          {
            "name": "Disabled",
            "value": "Disabled"
          },
          {
            "name": "Enabled",
            "value": "Enabled"
          }
        ]
      }
    },
    "CrossSubscriptionRestoreSettings": {
      "type": "object",
      "description": "CrossSubscriptionRestore Settings",
      "properties": {
        "state": {
          "$ref": "#/$defs/CrossSubscriptionRestoreState",
          "description": "CrossSubscriptionRestore state"
        }
      }
    },
    "CrossSubscriptionRestoreState": {
      "type": "string",
      "description": "CrossSubscriptionRestore state",
      "enum": [
        "Disabled",
        "PermanentlyDisabled",
        "Enabled"
      ],
      "x-ms-enum": {
        "name": "CrossSubscriptionRestoreState",
        "modelAsString": true,
        "values": [
          {
            "name": "Disabled",
            "value": "Disabled"
          },
          {
            "name": "PermanentlyDisabled",
            "value": "PermanentlyDisabled"
          },
          {
            "name": "Enabled",
            "value": "Enabled"
          }
        ]
      }
    },
    "DppIdentityDetails": {
      "type": "object",
      "description": "Identity details",
      "properties": {
        "principalId": {
          "type": "string",
          "description": "The object ID of the service principal object for the managed identity that is used to grant role-based access to an Azure resource.",
          "readOnly": true
        },
        "tenantId": {
          "type": "string",
          "description": "A Globally Unique Identifier (GUID) that represents the Azure AD tenant where the resource is now a member.",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "The identityType which can be either SystemAssigned, UserAssigned, 'SystemAssigned,UserAssigned' or None"
        },
        "userAssignedIdentities": {
          "type": "object",
          "description": "Gets or sets the user assigned identities.",
          "additionalProperties": {
            "$ref": "../../../../../../common-types/resource-management/v5/managedidentity.json#/definitions/UserAssignedIdentity"
          }
        }
      }
    },
    "EncryptionState": {
      "type": "string",
      "description": "Encryption state of the Backup Vault.",
      "enum": [
        "Enabled",
        "Disabled",
        "Inconsistent"
      ],
      "x-ms-enum": {
        "name": "EncryptionState",
        "modelAsString": true,
        "values": [
          {
            "name": "Enabled",
            "value": "Enabled",
            "description": "CMK encryption is enabled on the Backup Vault"
          },
          {
            "name": "Disabled",
            "value": "Disabled",
            "description": "CMK encryption is disabled on the Backup Vault. User can not set this state once Encryption State is 'Enabled'."
          },
          {
            "name": "Inconsistent",
            "value": "Inconsistent",
            "description": "CMK encryption is in inconsistent state on the Backup Vault. This state indicates that user needs to retry the encryption settings operation immediately to correct the state."
          }
        ]
      }
    },
    "FeatureSettings": {
      "type": "object",
      "description": "Class containing feature settings of vault",
      "properties": {
        "crossSubscriptionRestoreSettings": {
          "$ref": "#/$defs/CrossSubscriptionRestoreSettings",
          "description": "CrossSubscriptionRestore Settings"
        },
        "crossRegionRestoreSettings": {
          "$ref": "#/$defs/CrossRegionRestoreSettings"
        }
      }
    },
    "GranularityLevel": {
      "type": "string",
      "enum": [
        "VaultLevel",
        "ProtectedItemLevel",
        "ProtectedItemWithParentTag"
      ],
      "x-ms-enum": {
        "name": "GranularityLevel",
        "modelAsString": true,
        "values": [
          {
            "name": "VaultLevel",
            "value": "VaultLevel"
          },
          {
            "name": "ProtectedItemLevel",
            "value": "ProtectedItemLevel"
          },
          {
            "name": "ProtectedItemWithParentTag",
            "value": "ProtectedItemWithParentTag"
          }
        ]
      }
    },
    "IdentityType": {
      "type": "string",
      "description": "The identity type. 'SystemAssigned' and 'UserAssigned' are mutually exclusive. 'SystemAssigned' will use implicitly created managed identity.",
      "enum": [
        "SystemAssigned",
        "UserAssigned"
      ],
      "x-ms-enum": {
        "name": "IdentityType",
        "modelAsString": true,
        "values": [
          {
            "name": "SystemAssigned",
            "value": "SystemAssigned"
          },
          {
            "name": "UserAssigned",
            "value": "UserAssigned"
          }
        ]
      }
    },
    "ImmutabilityConfiguration": {
      "type": "object",
      "description": "Immutability configuration containing type and duration.",
      "properties": {
        "type": {
          "$ref": "#/$defs/ImmutabilityType",
          "description": "Type of immutability. Supported values: AsPerPolicy or TimeBased."
        },
        "durationInDays": {
          "type": "integer",
          "format": "int32",
          "description": "Duration in days for time-based immutability.\nRequired when type is TimeBased. Must be null when type is AsPerPolicy."
        }
      }
    },
    "ImmutabilitySettings": {
      "type": "object",
      "description": "Immutability Settings at vault level",
      "properties": {
        "state": {
          "$ref": "#/$defs/ImmutabilityState",
          "description": "Immutability state"
        },
        "configuration": {
          "$ref": "#/$defs/ImmutabilityConfiguration",
          "description": "Immutability configuration containing type and duration."
        }
      }
    },
    "ImmutabilityState": {
      "type": "string",
      "description": "Immutability state",
      "enum": [
        "Disabled",
        "Unlocked",
        "Locked"
      ],
      "x-ms-enum": {
        "name": "ImmutabilityState",
        "modelAsString": true,
        "values": [
          {
            "name": "Disabled",
            "value": "Disabled"
          },
          {
            "name": "Unlocked",
            "value": "Unlocked"
          },
          {
            "name": "Locked",
            "value": "Locked"
          }
        ]
      }
    },
    "ImmutabilityType": {
      "type": "string",
      "description": "Type of immutability configuration.",
      "enum": [
        "AsPerPolicy",
        "TimeBased"
      ],
      "x-ms-enum": {
        "name": "ImmutabilityType",
        "modelAsString": true,
        "values": [
          {
            "name": "AsPerPolicy",
            "value": "AsPerPolicy",
            "description": "Immutability is enforced as per the backup policy retention."
          },
          {
            "name": "TimeBased",
            "value": "TimeBased",
            "description": "Time-based immutability with a configurable duration window."
          }
        ]
      }
    },
    "InfrastructureEncryptionState": {
      "type": "string",
      "description": "Enabling/Disabling the Double Encryption state",
      "enum": [
        "Enabled",
        "Disabled"
      ],
      "x-ms-enum": {
        "name": "InfrastructureEncryptionState",
        "modelAsString": true,
        "values": [
          {
            "name": "Enabled",
            "value": "Enabled"
          },
          {
            "name": "Disabled",
            "value": "Disabled"
          }
        ]
      }
    },
    "MonitoringSettings": {
      "type": "object",
      "description": "Monitoring Settings",
      "properties": {
        "azureMonitorAlertSettings": {
          "$ref": "#/$defs/AzureMonitorAlertSettings",
          "description": "Settings for Azure Monitor based alerts"
        }
      }
    },
    "PatchBackupVaultInput": {
      "type": "object",
      "description": "Backup Vault Contract for Patch Backup Vault API.",
      "properties": {
        "monitoringSettings": {
          "$ref": "#/$defs/MonitoringSettings",
          "description": "Monitoring Settings"
        },
        "securitySettings": {
          "$ref": "#/$defs/SecuritySettings",
          "description": "Security Settings"
        },
        "featureSettings": {
          "$ref": "#/$defs/FeatureSettings",
          "description": "Feature Settings"
        },
        "costManagementSettings": {
          "$ref": "#/$defs/CostManagementSettings",
          "description": "Cost Management Settings of the vault"
        },
        "resourceGuardOperationRequests": {
          "type": "array",
          "description": "ResourceGuardOperationRequests on which LAC check will be performed",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "SecuritySettings": {
      "type": "object",
      "description": "Class containing security settings of vault",
      "properties": {
        "softDeleteSettings": {
          "$ref": "#/$defs/SoftDeleteSettings",
          "description": "Soft delete related settings"
        },
        "immutabilitySettings": {
          "$ref": "#/$defs/ImmutabilitySettings",
          "description": "Immutability Settings at vault level"
        },
        "encryptionSettings": {
          "$ref": "#/$defs/encryptionSettings",
          "description": "Customer Managed Key details of the resource."
        }
      }
    },
    "SoftDeleteSettings": {
      "type": "object",
      "description": "Soft delete related settings",
      "properties": {
        "state": {
          "$ref": "#/$defs/SoftDeleteState",
          "description": "State of soft delete"
        },
        "retentionDurationInDays": {
          "type": "number",
          "format": "double",
          "description": "Soft delete retention duration"
        }
      }
    },
    "SoftDeleteState": {
      "type": "string",
      "description": "State of soft delete",
      "enum": [
        "Off",
        "On",
        "AlwaysOn"
      ],
      "x-ms-enum": {
        "name": "SoftDeleteState",
        "modelAsString": true,
        "values": [
          {
            "name": "Off",
            "value": "Off",
            "description": "Soft Delete is turned off for the BackupVault"
          },
          {
            "name": "On",
            "value": "On",
            "description": "Soft Delete is enabled for the BackupVault but can be turned off"
          },
          {
            "name": "AlwaysOn",
            "value": "AlwaysOn",
            "description": "Soft Delete is permanently enabled for the BackupVault and the setting cannot be changed"
          }
        ]
      }
    },
    "encryptionSettings": {
      "type": "object",
      "description": "Customer Managed Key details of the resource.",
      "properties": {
        "state": {
          "$ref": "#/$defs/EncryptionState",
          "description": "Encryption state of the Backup Vault."
        },
        "keyVaultProperties": {
          "$ref": "#/$defs/CmkKeyVaultProperties",
          "description": "The properties of the Key Vault which hosts CMK"
        },
        "kekIdentity": {
          "$ref": "#/$defs/CmkKekIdentity",
          "description": "The details of the managed identity used for CMK"
        },
        "infrastructureEncryption": {
          "$ref": "#/$defs/InfrastructureEncryptionState",
          "description": "Enabling/Disabling the Double Encryption state"
        }
      }
    }
  }
}