{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/canonical/main/json-schema/canonical-artefact-matching-rule-patch-schema.json",
  "title": "ArtefactMatchingRulePatch",
  "description": "Patch request for artefact matching rule",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canonical-artefact-matching-rules-api-openapi.yml#/components/schemas/ArtefactMatchingRulePatch",
  "properties": {
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "family": {
      "anyOf": [
        {
          "$ref": "#/$defs/FamilyName"
        },
        {
          "type": "null"
        }
      ]
    },
    "stage": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stage"
    },
    "track": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Track"
    },
    "branch": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Branch"
    },
    "store": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Store"
    },
    "series": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Series"
    },
    "os": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Os"
    },
    "release": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Release"
    },
    "owner": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Owner"
    },
    "team_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Team Ids"
    },
    "grant_permissions": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Permission"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Grant Permissions"
    }
  },
  "type": "object",
  "$defs": {
    "FamilyName": {
      "type": "string",
      "enum": [
        "snap",
        "deb",
        "charm",
        "image",
        "solution"
      ],
      "title": "FamilyName"
    },
    "Permission": {
      "type": "string",
      "enum": [
        "view_user",
        "change_user",
        "view_team",
        "change_team",
        "add_application",
        "change_application",
        "view_application",
        "view_permission",
        "view_issue",
        "change_issue",
        "change_issue_attachment",
        "change_issue_attachment_bulk",
        "change_attachment_rule",
        "change_auto_rerun",
        "view_test",
        "change_test",
        "view_rerun",
        "change_rerun",
        "change_rerun_bulk",
        "view_artefact",
        "change_artefact",
        "view_environment_review",
        "change_environment_review",
        "view_report",
        "view_test_case_reported_issue",
        "change_test_case_reported_issue",
        "view_environment_reported_issue",
        "change_environment_reported_issue",
        "view_notification",
        "change_notification",
        "view_sentry_debug"
      ],
      "title": "Permission"
    }
  }
}