{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/canonical/main/json-schema/canonical-artefact-matching-rule-response-schema.json",
  "title": "ArtefactMatchingRuleResponse",
  "description": "Artefact matching rule with associated teams",
  "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/ArtefactMatchingRuleResponse",
  "properties": {
    "id": {
      "type": "integer",
      "title": "Id"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name"
    },
    "family": {
      "$ref": "#/$defs/FamilyName"
    },
    "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"
    },
    "teams": {
      "items": {
        "$ref": "#/$defs/TeamMinimal"
      },
      "type": "array",
      "title": "Teams"
    },
    "grant_permissions": {
      "items": {
        "$ref": "#/$defs/Permission"
      },
      "type": "array",
      "title": "Grant Permissions"
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "family",
    "stage",
    "track",
    "branch",
    "store",
    "series",
    "os",
    "release",
    "owner",
    "teams",
    "grant_permissions"
  ],
  "$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"
    },
    "TeamMinimal": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "TeamMinimal"
    }
  }
}