{
"$defs": {
"RetentionScope": {
"description": "Which level a retention policy sets (`kind` tag).",
"oneOf": [
{
"additionalProperties": false,
"description": "The whole install (DMs use it too). A struct variant so unknown fields are refused.",
"properties": {
"kind": {
"const": "install",
"type": "string"
}
},
"required": [
"kind"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "One space and every channel in it.",
"properties": {
"id": {
"description": "The space.",
"pattern": "^[1-9][0-9]{0,18}$",
"type": "string"
},
"kind": {
"const": "space",
"type": "string"
}
},
"required": [
"kind",
"id"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "One channel, DM or group DM.",
"properties": {
"id": {
"description": "The channel.",
"pattern": "^[1-9][0-9]{0,18}$",
"type": "string"
},
"kind": {
"const": "channel",
"type": "string"
}
},
"required": [
"kind",
"id"
],
"type": "object"
}
]
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "Body of `POST /api/v1/compliance/retention/set`: exactly one form, `{preview_id}` (a\nshorter value, from a finished preview) or `{scope, …values}` (not shorter: active at once).",
"properties": {
"deleted_purge_days": {
"description": "Install only (without `preview_id`).",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"files_days": {
"description": "Days for files (without `preview_id`).",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"messages_days": {
"description": "Days for messages (without `preview_id`).",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"preview_id": {
"description": "A finished preview of the proposal.",
"pattern": "^[1-9][0-9]{0,18}$",
"type": [
"string",
"null"
]
},
"scope": {
"anyOf": [
{
"$ref": "#/$defs/RetentionScope"
},
{
"type": "null"
}
],
"description": "The level (without `preview_id`)."
}
},
"title": "SetRetentionRequest",
"type": "object"
}