{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-gouv-fr/json-schema/api-gouv-fr-notification-setting-page-schema.json",
  "title": "NotificationSettingPage",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-gouv-fr-notifications-api-openapi.yml#/components/schemas/NotificationSettingPage",
  "properties": {
    "data": {
      "description": "The page data",
      "items": {
        "$ref": "#/$defs/NotificationSetting__read"
      },
      "type": "array"
    },
    "next_page": {
      "description": "The next page URL if exists",
      "type": "string"
    },
    "page": {
      "description": "The current page",
      "minimum": 1,
      "type": "integer"
    },
    "page_size": {
      "description": "The page size used for pagination",
      "minimum": 0,
      "type": "integer"
    },
    "previous_page": {
      "description": "The previous page URL if exists",
      "type": "string"
    },
    "total": {
      "description": "The total paginated items",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "page",
    "page_size",
    "total"
  ],
  "type": "object",
  "$defs": {
    "Badge__read": {
      "properties": {
        "kind": {
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    "BaseReference": {
      "properties": {
        "class": {
          "description": "The object class",
          "type": "string"
        },
        "id": {
          "description": "The object unique identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "ModelReference": {
      "properties": {
        "class": {
          "description": "The model class",
          "type": "string"
        },
        "id": {
          "description": "The object identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "NotificationSetting__read": {
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "event": {
          "description": "A notification type, or a dotted prefix of some (`discussion` covers `discussion.*`), null for every notification",
          "type": "string"
        },
        "id": {
          "readOnly": true,
          "type": "string"
        },
        "origin": {
          "description": "What made the user follow the subject: by hand, by editing it, or by taking part in its discussions",
          "enum": [
            "followed",
            "edited",
            "discussed"
          ],
          "readOnly": true,
          "type": "string"
        },
        "scope": {
          "allOf": [
            {
              "$ref": "#/$defs/ModelReference"
            }
          ],
          "description": "The subject the rule is about, null for everywhere"
        },
        "subject": {
          "allOf": [
            {
              "$ref": "#/$defs/NotificationSubjectSummary"
            }
          ],
          "description": "The subject as the user may see it today, null once out of reach",
          "readOnly": true
        }
      },
      "required": [
        "enabled",
        "id"
      ],
      "type": "object"
    },
    "NotificationSubjectSummary": {
      "properties": {
        "organization": {
          "allOf": [
            {
              "$ref": "#/$defs/OrganizationReference"
            }
          ],
          "description": "The organization the subject belongs to, null for an organization"
        },
        "page": {
          "description": "The subject web page",
          "type": "string"
        },
        "title": {
          "description": "The subject title",
          "type": "string"
        }
      },
      "type": "object"
    },
    "OrganizationPermissions": {
      "properties": {
        "delete": {
          "type": "boolean"
        },
        "edit": {
          "type": "boolean"
        },
        "harvest": {
          "type": "boolean"
        },
        "members": {
          "type": "boolean"
        },
        "private": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "OrganizationReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {
            "acronym": {
              "maxLength": 128,
              "type": "string"
            },
            "badges": {
              "items": {
                "allOf": [
                  {
                    "$ref": "#/$defs/Badge__read"
                  }
                ],
                "readOnly": true
              },
              "readOnly": true,
              "type": "array"
            },
            "logo": {
              "description": "URL of the image",
              "readOnly": true,
              "type": "string"
            },
            "logo_thumbnail": {
              "description": "URL of the cropped and squared image (100x100)",
              "readOnly": true,
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "page": {
              "description": "Link to the udata web page for this organization",
              "readOnly": true,
              "type": "string"
            },
            "permissions": {
              "allOf": [
                {
                  "$ref": "#/$defs/OrganizationPermissions"
                }
              ],
              "readOnly": true
            },
            "slug": {
              "maxLength": 255,
              "readOnly": true,
              "type": "string"
            },
            "uri": {
              "description": "Link to the API endpoint for this organization",
              "readOnly": true,
              "type": "string"
            }
          },
          "required": [
            "name",
            "slug"
          ],
          "type": "object"
        }
      ]
    }
  }
}