{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-send-push-notification-request-schema.json",
  "title": "SendPushNotificationRequest",
  "description": "A request for sending a push notification for a user.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-user-push-notification-management-api-openapi.yml#/components/schemas/SendPushNotificationRequest",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "A mandatory push notification type.",
      "enum": [
        "TRUSTX",
        "GENERIC"
      ]
    },
    "ttlSeconds": {
      "type": "integer",
      "format": "int32",
      "description": "Mandatory time-to-live for the push notification in seconds."
    },
    "retryDurationHintSeconds": {
      "type": "integer",
      "format": "int32",
      "description": "Optional length of time that the push notification will be retried if it fails to send. If not provided a default of 60 seconds is used.\nThis describes the minimum duration for which retries will be attempted and is not exact."
    },
    "content": {
      "$ref": "#/$defs/PushNotificationContent",
      "description": "Push notification content."
    },
    "trustXPushRequestParams": {
      "$ref": "#/$defs/TrustXPushRequestParams",
      "description": "Parameters required for a push notification of type: TRUSTX."
    }
  },
  "required": [
    "content",
    "type"
  ],
  "$defs": {
    "ChildTrustXProcess": {
      "type": "object",
      "description": "Information about the TrustX process which is executed as the push notification action.",
      "properties": {
        "processDefnName": {
          "type": "string",
          "description": "Optional. The TrustX process definition name. Either name and version or a tag must be provided."
        },
        "processDefnVersion": {
          "type": "integer",
          "format": "int32",
          "description": "Optional. The TrustX process definition version. Either name and version or a tag must be provided."
        },
        "processDefnTag": {
          "type": "string",
          "description": "Optional. The TrustX process definition tag. Either name and version or a tag must be provided."
        },
        "monitorStatus": {
          "type": "boolean",
          "description": "If present and true then the status of the push notification TrustX process will be monitored.\nA polling URL will be generated which facilitates polling of the process status to wait for its completion."
        },
        "initParams": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          },
          "description": "Optional parameters to be supplied to the TrustX process when it is started."
        }
      }
    },
    "ParentTrustXProcess": {
      "type": "object",
      "description": "Information about the TrustX process which is executed as the push notification action.",
      "properties": {
        "processDefnId": {
          "type": "string",
          "description": "The TrustX process definition identifier.",
          "minLength": 1
        },
        "processDefnName": {
          "type": "string",
          "description": "The TrustX process definition name.",
          "minLength": 1
        },
        "processDefnVersion": {
          "type": "integer",
          "format": "int32",
          "description": "The TrustX process definition version."
        },
        "processInstanceId": {
          "type": "string",
          "description": "The TrustX process instance ID.",
          "minLength": 1
        }
      }
    },
    "PushNotificationContent": {
      "type": "object",
      "description": "Contents of a push notification.",
      "properties": {
        "title": {
          "type": "string",
          "description": "A push notification title."
        },
        "message": {
          "type": "string",
          "description": "A push notification message."
        },
        "titleLocKey": {
          "type": "string",
          "description": "Optional key for a localisable push notification title."
        },
        "titleLocArgs": {
          "type": "array",
          "description": "Optional arguments for a localisable push notification title.",
          "items": {
            "type": "string"
          }
        },
        "messageLocKey": {
          "type": "string",
          "description": "Optional key for a localisable push notification message."
        },
        "messageLocArgs": {
          "type": "array",
          "description": "Optional arguments for a localisable push notification message.",
          "items": {
            "type": "string"
          }
        },
        "customProperties": {
          "type": "object",
          "additionalProperties": {
            "type": "object"
          },
          "description": "Optional custom properties to be included with the push notification."
        }
      }
    },
    "TrustXPushRequestParams": {
      "type": "object",
      "description": "Information required to create a TrustX push notification which is managed using a TrustX process.",
      "properties": {
        "parentTrustXProcess": {
          "$ref": "#/$defs/ParentTrustXProcess",
          "description": "The mandatory TrustX process from which the push notification is requested."
        },
        "childTrustXProcess": {
          "$ref": "#/$defs/ChildTrustXProcess",
          "description": "The mandatory TrustX process which is executed as the push notification action."
        }
      },
      "required": [
        "childTrustXProcess",
        "parentTrustXProcess"
      ]
    }
  }
}