{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-policy/json-schema/microsoft-azure-policy-policy-assignment-update-schema.json",
  "title": "PolicyAssignmentUpdate",
  "description": "The policy assignment for Patch request.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-policy-policyassignments-api-openapi.yml#/components/schemas/PolicyAssignmentUpdate",
  "type": "object",
  "properties": {
    "properties": {
      "x-ms-client-flatten": true,
      "$ref": "#/$defs/PolicyAssignmentUpdateProperties",
      "description": "The policy assignment properties for Patch request."
    },
    "location": {
      "type": "string",
      "description": "The location of the policy assignment. Only required when utilizing managed identity."
    },
    "identity": {
      "$ref": "#/$defs/Identity",
      "description": "The managed identity associated with the policy assignment."
    }
  },
  "$defs": {
    "Identity": {
      "type": "object",
      "properties": {
        "principalId": {
          "readOnly": true,
          "type": "string",
          "description": "The principal ID of the resource identity.  This property will only be provided for a system assigned identity"
        },
        "tenantId": {
          "readOnly": true,
          "type": "string",
          "description": "The tenant ID of the resource identity.  This property will only be provided for a system assigned identity"
        },
        "type": {
          "type": "string",
          "description": "The identity type. This is the only required field when adding a system or user assigned identity to a resource.",
          "enum": [
            "SystemAssigned",
            "UserAssigned",
            "None"
          ],
          "x-ms-enum": {
            "name": "ResourceIdentityType",
            "modelAsString": false,
            "values": [
              {
                "value": "SystemAssigned",
                "description": "Indicates that a system assigned identity is associated with the resource."
              },
              {
                "value": "UserAssigned",
                "description": "Indicates that a system assigned identity is associated with the resource."
              },
              {
                "value": "None",
                "description": "Indicates that no identity is associated with the resource or that the existing identity should be removed."
              }
            ]
          }
        },
        "userAssignedIdentities": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "x-ms-client-name": "userAssignedIdentitiesValue",
            "properties": {
              "principalId": {
                "readOnly": true,
                "type": "string",
                "description": "The principal id of user assigned identity."
              },
              "clientId": {
                "readOnly": true,
                "type": "string",
                "description": "The client id of user assigned identity."
              }
            }
          },
          "description": "The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'."
        }
      },
      "description": "Identity for the resource.  Policy assignments support a maximum of one identity.  That is either a system assigned identity or a single user assigned identity."
    },
    "Override": {
      "description": "The policy property value override.",
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "description": "The override kind.",
          "enum": [
            "policyEffect",
            "definitionVersion"
          ],
          "x-ms-enum": {
            "name": "OverrideKind",
            "modelAsString": true,
            "values": [
              {
                "value": "policyEffect",
                "description": "It will override the policy effect type."
              },
              {
                "value": "definitionVersion",
                "description": "It will override the definition version property value of the policy assignment."
              }
            ]
          }
        },
        "value": {
          "type": "string",
          "description": "The value to override the policy property."
        },
        "selectors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Selector"
          },
          "x-ms-identifiers": [],
          "description": "The list of the selector expressions."
        }
      }
    },
    "PolicyAssignmentUpdateProperties": {
      "type": "object",
      "properties": {
        "resourceSelectors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ResourceSelector"
          },
          "x-ms-identifiers": [],
          "description": "The resource selector list to filter policies by resource properties."
        },
        "overrides": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Override"
          },
          "x-ms-identifiers": [],
          "description": "The policy property value override."
        }
      },
      "description": "The policy assignment properties for Patch request."
    },
    "ResourceSelector": {
      "description": "The resource selector to filter policies by resource properties.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the resource selector."
        },
        "selectors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Selector"
          },
          "x-ms-identifiers": [],
          "description": "The list of the selector expressions."
        }
      }
    }
  }
}