toolsOzoneModerationScheduleAction top-level constant

Map<String, dynamic> const toolsOzoneModerationScheduleAction

tools.ozone.moderation.scheduleAction

Implementation

const toolsOzoneModerationScheduleAction = <String, dynamic>{
  "lexicon": 1,
  "id": "tools.ozone.moderation.scheduleAction",
  "defs": {
    "main": {
      "type": "procedure",
      "description":
          "Schedule a moderation action to be executed at a future time",
      "input": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": ["action", "subjects", "createdBy", "scheduling"],
          "properties": {
            "action": {
              "type": "union",
              "refs": ["#takedown"],
            },
            "subjects": {
              "type": "array",
              "description": "Array of DID subjects to schedule the action for",
              "items": {"type": "string", "format": "did"},
              "maxLength": 100,
            },
            "createdBy": {"type": "string", "format": "did"},
            "scheduling": {"type": "ref", "ref": "#schedulingConfig"},
            "modTool": {
              "type": "ref",
              "description":
                  "This will be propagated to the moderation event when it is applied",
              "ref": "tools.ozone.moderation.defs#modTool",
            },
          },
        },
      },
      "output": {
        "encoding": "application/json",
        "schema": {"type": "ref", "ref": "#scheduledActionResults"},
      },
    },
    "takedown": {
      "type": "object",
      "description": "Schedule a takedown action",
      "properties": {
        "comment": {"type": "string"},
        "durationInHours": {
          "type": "integer",
          "description":
              "Indicates how long the takedown should be in effect before automatically expiring.",
        },
        "acknowledgeAccountSubjects": {
          "type": "boolean",
          "description":
              "If true, all other reports on content authored by this account will be resolved (acknowledged).",
        },
        "policies": {
          "type": "array",
          "description":
              "Names/Keywords of the policies that drove the decision.",
          "items": {"type": "string"},
          "maxLength": 5,
        },
        "severityLevel": {
          "type": "string",
          "description":
              "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).",
        },
        "strikeCount": {
          "type": "integer",
          "description":
              "Number of strikes to assign to the user when takedown is applied.",
        },
        "strikeExpiresAt": {
          "type": "string",
          "format": "datetime",
          "description":
              "When the strike should expire. If not provided, the strike never expires.",
        },
        "emailContent": {
          "type": "string",
          "description": "Email content to be sent to the user upon takedown.",
        },
        "emailSubject": {
          "type": "string",
          "description":
              "Subject of the email to be sent to the user upon takedown.",
        },
      },
    },
    "schedulingConfig": {
      "type": "object",
      "description": "Configuration for when the action should be executed",
      "properties": {
        "executeAt": {
          "type": "string",
          "format": "datetime",
          "description": "Exact time to execute the action",
        },
        "executeAfter": {
          "type": "string",
          "format": "datetime",
          "description":
              "Earliest time to execute the action (for randomized scheduling)",
        },
        "executeUntil": {
          "type": "string",
          "format": "datetime",
          "description":
              "Latest time to execute the action (for randomized scheduling)",
        },
      },
    },
    "scheduledActionResults": {
      "type": "object",
      "required": ["succeeded", "failed"],
      "properties": {
        "succeeded": {
          "type": "array",
          "items": {"type": "string", "format": "did"},
        },
        "failed": {
          "type": "array",
          "items": {"type": "ref", "ref": "#failedScheduling"},
        },
      },
    },
    "failedScheduling": {
      "type": "object",
      "required": ["subject", "error"],
      "properties": {
        "subject": {"type": "string", "format": "did"},
        "error": {"type": "string"},
        "errorCode": {"type": "string"},
      },
    },
  },
};