PushNotification

@Serializable
data class PushNotification(val id: String = UUID.randomUUID().toString(), val credentialId: String, val ttl: Int, val messageId: String, val messageText: String? = null, val customPayload: String? = null, val challenge: String? = null, var numbersChallenge: String? = null, val loadBalancer: String? = null, val contextInfo: String? = null, val pushType: PushType, val createdAt: Date = Date(), val sentAt: Date? = null, var respondedAt: Date? = null, val additionalData: Map<String, Any>? = null, var approved: Boolean = false, var pending: Boolean = true)

Represents a push notification authentication challenge. This model holds all necessary information about a push notification challenge.

Constructors

Link copied to clipboard
constructor(id: String = UUID.randomUUID().toString(), credentialId: String, ttl: Int, messageId: String, messageText: String? = null, customPayload: String? = null, challenge: String? = null, numbersChallenge: String? = null, loadBalancer: String? = null, contextInfo: String? = null, pushType: PushType, createdAt: Date = Date(), sentAt: Date? = null, respondedAt: Date? = null, additionalData: Map<String, Any>? = null, approved: Boolean = false, pending: Boolean = true)

Types

Link copied to clipboard
object AdditionalDataSerializer : KSerializer<Map<String, Any>?>

Custom serializer for Maps with Any values.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Optional additional custom data associated with this notification. This is a map of key-value pairs. The values can be of any type (String, Number, Boolean, Map, List, etc.). This field is serialized/deserialized as a JSON string.

Link copied to clipboard
@EncodeDefault
var approved: Boolean

Whether this notification has been approved by the user.

Link copied to clipboard
val challenge: String? = null

Optional challenge data (e.g., verification code).

Link copied to clipboard
val contextInfo: String? = null

Optional additional context information. In PingAM, this may contain details such as IP address, user agent, location, etc.

Link copied to clipboard
@Serializable(with = DateSerializer::class)
val createdAt: Date

Timestamp when this notification was created.

Link copied to clipboard

The ID of the associated credential.

Link copied to clipboard
val customPayload: String? = null

Optional additional custom payload data.

Link copied to clipboard

Checks if this notification has expired.

Link copied to clipboard
val id: String

Unique identifier for this notification.

Link copied to clipboard
val loadBalancer: String? = null

Optional cookie for load balancing. Used to route the request to the correct server in PingAM.

Link copied to clipboard

Optional message ID from the push provider.

Link copied to clipboard
val messageText: String? = null

Optional message to display to the user.

Link copied to clipboard

Optional challenge with numeric format.

Link copied to clipboard
@EncodeDefault
var pending: Boolean

Whether this notification is pending (not yet approved or denied).

Link copied to clipboard
@Serializable(with = PushTypeSerializer::class)
val pushType: PushType

The type of push notification (DEFAULT, CHALLENGE, BIOMETRIC).

Link copied to clipboard

Checks if the user has responded to this notification.

Link copied to clipboard

Timestamp when the user responded to this notification.

Link copied to clipboard
@Serializable(with = NullableDateSerializer::class)
val sentAt: Date? = null

Optional timestamp from the server when this notification was sent.

Link copied to clipboard
val ttl: Int

Time to live in seconds for this notification.

Link copied to clipboard

String representation of the push notification type.

Functions

Link copied to clipboard

Get numbers used for push challenge

Link copied to clipboard

Mark this notification as approved.

Link copied to clipboard

Mark this notification as denied.

Link copied to clipboard
fun toJson(): String

Converts this notification to a JSON string representation.